<TextBlock Text="{Binding text,Converter={StaticResource visibleconvert}}"
Foreground="Black">
</TextBlock>
public object Convert(object value, Type targetType, object parameter, string language)
{
TextBlock txt = new TextBlock();
string str = (string)value;
string[] strList = str.Split('=');
Run run2 = new Run();
run2.Text = strList[1];
SolidColorBrush mySolidColorBrush = new SolidColorBrush(Colors.Blue);
run2.Foreground = mySolidColorBrush;
txt.Inlines.Add(run2);
return txt;
}
As results is "Windows.UI.Xaml.Controls.TextBlock
". I had debugger then return txt
is null
while "txt.Inlines.Add(run2);
" is having data. Everyone help me to solve it.