How to bind string of class to resource dictionary

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to bind string of class to resource dictionary



I have many tooltips saved in file hints.xaml . Like this :


<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApp7.Theme"
x:Class="WpfApp7.Theme.Hints">


<ToolTip x:Key="myToolTip" >
<StackPanel >
<Label Content="Nadpis" />
<TextBlock Text="................"/>
</StackPanel>
</ToolTip>
</ResourceDictionary>



How i can bind string of class Enviroment.CurrentDictionary on my Text="................" ?



I tried to create code behind for Hints.xaml and bind by DataContext but didnt work .




1 Answer
1



Try this:


<StackPanel xmlns:system="clr-namespace:System;assembly=mscorlib">
<Label Content="Nadpis" />
<TextBlock Text="x:Static system:Environment.CurrentDirectory"/>
</StackPanel>






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard