User control binding and usage
Hi. I have an user control
It has ItemText.
So, now I want to use the control somewhere:
How the properties should be defined in the control to work properly? I tried some, but always has "the property was not found in type".
Code: Select all
<UserControl x:Class="HUD.UserStateIcon"
...
xmlns:local="clr-namespace:HUD"
d:DesignHeight="50" d:DesignWidth="50" RenderTransformOrigin="0.5,0.5">
...
<Grid x:Name="Root" RenderTransformOrigin="0.5,0.5">
<Label x:Name="Text" Content="{Binding ItemText}" Grid.Row="1"/>
</Grid>
</UserControl>So, now I want to use the control somewhere:
Code: Select all
<Window x:Class="HUD.MainWindow"
...
<Grid>
<local:UserStateIcon Grid.Column="1" ItemText="Hello world"/>
</Grid>-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: User control binding and usage
Hi Dmirty,
Have you read our UserControls tutorial?
Do you need this for Native SDK, Unity or Unreal?
Have you read our UserControls tutorial?
Do you need this for Native SDK, Unity or Unreal?
Who is online
Users browsing this forum: Bing [Bot] and 5 guests