|
<Window x:Class="GaugeFormatter.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:l="clr-namespace:GaugeFormatter"
Title="GaugeFormatter" Height="300" Width="300"
>
<Window.Resources>
<ObjectDataProvider ObjectType="{x:Type l:DataSource}" x:Key="data"/>
<l:DataConverter x:Key="converter"/>
<DataTemplate x:Key="template">
<TextBlock Text="{Binding}" Margin="5,5,5,5" TextAlignment="Right" Padding="0,0,20,0" Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBox}}, Path=ActualWidth}">
<TextBlock.Background>
<LinearGradientBrush EndPoint="{Binding Converter={StaticResource converter}, ConverterParameter=1000}" StartPoint="0,0.5">
<GradientStop Color="#FF7CA0CF" Offset="0"/>
<GradientStop Color="#FF7CA0CF" Offset="0.8"/>
<GradientStop Color="#FFFFFFFF" Offset="1"/>
</LinearGradientBrush>
</TextBlock.Background>
</TextBlock>
</DataTemplate>
</Window.Resources>
<StackPanel>
<Button Click="ReDo">Regenerate</Button>
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Hidden" ItemsSource="{Binding Source={StaticResource data}}" ItemTemplate="{StaticResource template}"/>
<TextBlock>
<Run ></Run>
</TextBlock>
</StackPanel>
</Window>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Hello! My name is Tamir Khason, and I am software architect, project manager, system analyst and [of course] programmer. In addition to writing big amount of documentation, I also write code, a lot of code. I used to work as a freelance architect, project manager, trainer, and consultant here, in Israel, but recently
join the company with extremely persuasive idea - to make a world better place. I have very pretty wife and 3 charming kids, but unfortunately almost no time for them.
To be updated within articles, I publishing,
visit my blog or
subscribe RSS feed. Also you can
follow me on Twitter to be up to date about my everyday life.