Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <rb:RateBase x:Class="RateBar.RateGraph"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:rb="clr-namespace:RateBar"
- xmlns:sd="clr-namespace:System.Windows.Data"
- mc:Ignorable="d">
- <RangeBase.Resources>
- <sd:ArithmeticConverter x:Key="progressConverter"/>
- <rb:JScriptConverter x:Key="JScript" TrapExceptions="False"/>
- <ControlTemplate x:Key="rateGraphTemplate" TargetType="{x:Type rb:RateBase}">
- <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
- <rb:Axis Width="380" Height="88"/>
- <Rectangle Height="88" Fill="#9690EE90">
- <Rectangle.Width>
- <MultiBinding Converter="{StaticResource JScript}" ConverterParameter="values[0]/values[1]*values[2]">
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Value"/>
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Maximum"/>
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Width"/>
- </MultiBinding>
- </Rectangle.Width>
- </Rectangle>
- <Label Canvas.Left="0" Width="380" HorizontalContentAlignment="Right" Foreground="Black" Content="{Binding Path=Caption, RelativeSource={RelativeSource TemplatedParent}}">
- <Canvas.Bottom>
- <MultiBinding Converter="{StaticResource JScript}" ConverterParameter="(values[2]*0.8)/values[1]*values[0]">
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Rate"/>
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="RateMaximum"/>
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Height"/>
- </MultiBinding>
- </Canvas.Bottom>
- </Label>
- <Line X1="0" X2="380" Stroke="Black">
- <Canvas.Bottom>
- <MultiBinding Converter="{StaticResource JScript}" ConverterParameter="(values[2]*0.8)/values[1]*values[0]">
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Rate"/>
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="RateMaximum"/>
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Height"/>
- </MultiBinding>
- </Canvas.Bottom>
- </Line>
- </Canvas>
- </ControlTemplate>
- </RangeBase.Resources>
- </rb:RateBase>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement