I have created class which has Static properties. Now i would like to bind all to textbox. but i couldn't able to bind.
Class with Static Properties:
namespace QSys.Library.Security
{
public class CustomerServiceData
{
public static string UserName
{
get
{
return "Imdad";
}
}
}
}
Page.xaml
<UserControl x:Class="QSys.Admin.Views.AdminHomeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:my="clr-namespace:QSys.Library.Security;assembly=QSys.Library"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="640">
<UserControl.Resources>
<my:CustomerServiceData x:Name="mySecurity" />
</UserControl.Resources>
<Grid>
<TextBox Text="{Binding Source={StaticResource mySecurity}, Path=CustomerServiceData.UserName}" ></TextBox>
</Grid>
</UserControl>
Can anybody suggest me why i am not getting values in my textbox? even it doesn't giving me any error yet.
Thanks, Imdadhusen