基本信息
源码名称: WPF的Ribbon 框架的应用
源码大小:0.08M
文件格式:.zip
开发语言:C#
更新时间:2018-06-15
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

Ribbon 框架实际案例

<ui:RibbonWindow x:Class="Crystalbyte.Ribbon.Demo.MainWindow"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:demo="clr-namespace:Crystalbyte.Ribbon.Demo"
                 xmlns:p="clr-namespace:Crystalbyte.Ribbon.Demo.Parts"
                 xmlns:ui="clr-namespace:Crystalbyte.UI;assembly=Crystalbyte.Ribbon"
                 Title="Ribbon Controls for WPF"
                 Width="1280"
                 Height="768"
                 MinWidth="640"
                 MinHeight="400"
                 Icon="Assets/crystalbyte.claw.png"
                 UseLayoutRounding="True"
                 WindowStartupLocation="CenterScreen">

    <ui:RibbonWindow.ApplicationMenu>
        <p:ApplicationMenu />
    </ui:RibbonWindow.ApplicationMenu>

    <ui:RibbonWindow.Ribbon>
        <p:Ribbon />
    </ui:RibbonWindow.Ribbon>

    <ui:RibbonWindow.StatusBarItemsSource>
        <p:StatusBarItemsSource />
    </ui:RibbonWindow.StatusBarItemsSource>

    <Border Padding="20">
        <ScrollViewer>
            <StackPanel>
                <TextBlock FontSize="24" Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType=ui:RibbonWindow}}">Choose an Accent</TextBlock>
                <ItemsControl Margin="0,10,0,0">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Command="{Binding ChangeColorCommand}" CommandParameter="accent">
                                <Button.Template>
                                    <ControlTemplate>
                                        <Border Width="80"
                                                Height="30"
                                                Background="{Binding Brush}"
                                                BorderBrush="Transparent"
                                                BorderThickness="2" />
                                    </ControlTemplate>
                                </Button.Template>
                            </Button>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                    <ItemsControl.ItemsSource>
                        <demo:ColorItemsSource />
                    </ItemsControl.ItemsSource>
                </ItemsControl>
                <TextBlock FontSize="24" Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType=ui:RibbonWindow}}">Choose a Background Brush</TextBlock>
                <ItemsControl Margin="0,10,0,0">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Command="{Binding ChangeColorCommand}" CommandParameter="background">
                                <Button.Template>
                                    <ControlTemplate>
                                        <Border Width="80"
                                                Height="30"
                                                Background="{Binding Brush}"
                                                BorderBrush="Transparent"
                                                BorderThickness="2" />
                                    </ControlTemplate>
                                </Button.Template>
                            </Button>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                    <ItemsControl.ItemsSource>
                        <demo:ColorItemsSource />
                    </ItemsControl.ItemsSource>
                </ItemsControl>
                <TextBlock FontSize="24" Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType=ui:RibbonWindow}}">Choose a Hover Brush</TextBlock>
                <ItemsControl Margin="0,10,0,0">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Command="{Binding ChangeColorCommand}" CommandParameter="hover">
                                <Button.Template>
                                    <ControlTemplate>
                                        <Border Width="80"
                                                Height="30"
                                                Background="{Binding Brush}"
                                                BorderBrush="Transparent"
                                                BorderThickness="2" />
                                    </ControlTemplate>
                                </Button.Template>
                            </Button>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                    <ItemsControl.ItemsSource>
                        <demo:ColorItemsSource />
                    </ItemsControl.ItemsSource>
                </ItemsControl>
                <TextBlock FontSize="24" Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType=ui:RibbonWindow}}">Choose a Foreground Brush</TextBlock>
                <ItemsControl Margin="0,10,0,0">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Command="{Binding ChangeColorCommand}" CommandParameter="foreground">
                                <Button.Template>
                                    <ControlTemplate>
                                        <Border Width="80"
                                                Height="30"
                                                Background="{Binding Brush}"
                                                BorderBrush="Transparent"
                                                BorderThickness="2" />
                                    </ControlTemplate>
                                </Button.Template>
                            </Button>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                    <ItemsControl.ItemsSource>
                        <demo:ColorItemsSource />
                    </ItemsControl.ItemsSource>
                </ItemsControl>
            </StackPanel>
        </ScrollViewer>
    </Border>

</ui:RibbonWindow>