Initialize DependencyProperty when declaring component?
Posted: 28 Jan 2022, 01:54
Hello,
I am currently have a component that we declare by doing the following:
BackVisible is an NsProp bool and the CenterText is a Noesis::String.
I would like to be able to be able to bind these values on our view in some cases while giving a explicit value in other cases.
In that case, we would have both
and
In order to bind it, we would need to utilize the DependencyProperty. However, I believe that the value of the DependencyProperty is set to the default value when we try to use the explicit declaration in Example A.
This code would make Back Visible even in Example A.
Am I going about this the wrong way or do we have a suggestion on how to do this?
Thank you,
Zane
I am currently have a component that we declare by doing the following:
Code: Select all
<components:BasicUI
x:Name="BasicUIBackground"
BackVisible="False"
CenterText="Insert Text Here"
PrivacyVisible="False" />I would like to be able to be able to bind these values on our view in some cases while giving a explicit value in other cases.
In that case, we would have both
Code: Select all
"Example A"
<components:BasicUI
x:Name="BasicUIBackground"
BackVisible="False"
CenterText="Insert Text Here"
PrivacyVisible="False" />Code: Select all
"Example B"
<components:BasicUI
x:Name="BasicUIBackground"
BackVisible="{Binding signup.isOnConsole}"
CenterText="{Binding Descriptor}"
PrivacyVisible="True" />Code: Select all
data->RegisterProperty<bool>(dpBackVisible, "BackVisible", Noesis::PropertyMetadata::Create(bool(true)));Am I going about this the wrong way or do we have a suggestion on how to do this?
Thank you,
Zane