可能你下载错了。。 直接帖代码吧。。。
- namespace Wpfdemo
- {
- /// <summary>
- /// MainWindow.xaml 的交互逻辑
- /// </summary>
- public partial class MainWindow : Window
- {
- private MainViewModel _vm;
- public MainWindow()
- {
- _vm = new MainViewModel();
- DataContext = _vm;
- InitializeComponent();
- C1.WPF.Theming.C1Blue.C1ThemeC1Blue theme = new C1.WPF.Theming.C1Blue.C1ThemeC1Blue();
- theme.Apply(this.FileToolBar);
- }
- }
- }
复制代码
- <Window x:Class="Wpfdemo.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
- Title="MainWindow" Height="350" Width="525">
- <Window.Resources>
- <Style TargetType="c1:C1ToolbarButton" x:Key="ctbButton">
- <Setter Property="Width" Value="Auto"></Setter>
- <Setter Property="MinWidth" Value="52"></Setter>
- <Setter Property="Height" Value="58"></Setter>
- <Setter Property="ToolTip" Value="工具栏"></Setter>
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="Foreground" Value="#333" />
- <Setter Property="VerticalAlignment" Value="Stretch"/>
- <Setter Property="Margin" Value="0,0,0,0"></Setter>
- </Style>
- <Style TargetType="Image" x:Key="ToolIcon">
- <Setter Property="Width" Value="28" />
- <Setter Property="Height" Value="35" />
- </Style>
- </Window.Resources>
- <Grid>
- <c1:C1Toolbar Name="FileToolBar" BorderThickness="0,0,0,1" BorderBrush="#b5bac0" ShowCollapseButton="True"
- ShowHelpButton="True" Padding="10,0,0,10"
- Height="77" VerticalContentAlignment="Center" VerticalAlignment="Center" Background="#f9f9fa" HorizontalAlignment="Stretch" >
- <c1:C1ToolbarStrip Height="77" ItemsSource="{Binding ToolBtnList}" Background="Transparent">
- <c1:C1ToolbarButton Style="{StaticResource ctbButton}" MouseOverBrush="Bisque" Cursor="Hand">
- <StackPanel Orientation="Vertical" Width="52" >
- <Image Source="print.png" Style="{StaticResource ToolIcon}"/>
- <TextBlock Text="打印" HorizontalAlignment="Center" Margin="0,3,0,0"></TextBlock>
- </StackPanel>
- </c1:C1ToolbarButton>
- </c1:C1ToolbarStrip>
- </c1:C1Toolbar>
- </Grid>
- </Window>
复制代码
|