首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >绑定fluent带状按钮上的单击事件

绑定fluent带状按钮上的单击事件
EN

Stack Overflow用户
提问于 2015-12-20 16:08:26
回答 1查看 943关注 0票数 1

我想试试流畅的丝带控制。这就是为什么我下载并添加到我的wpf项目。我的xaml代码是

代码语言:javascript
复制
<Fluent:RibbonWindow x:Class="Fluent.Sample.Foundation.Window"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     
    xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"     
    Title="Fluent.Sample.Foundation" Width="800" Height="600" WindowStartupLocation="CenterScreen" >


    <Fluent:Ribbon>
        <!--Backstage-->
        <Fluent:Ribbon.Menu>
            <Fluent:Backstage></Fluent:Backstage>
        </Fluent:Ribbon.Menu>
        <!--Tabs-->
        <Fluent:RibbonTabItem Header="Tab">
            <Fluent:RibbonGroupBox Header="Group">
                <Fluent:Button Name="buttonGreen" Header="Green" Icon="Images\Green.png" LargeIcon="Images\GreenLarge.png" Click="btnClick" />
                <Fluent:Button Name="buttonGray" Header="Grey" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" />
            </Fluent:RibbonGroupBox>
        </Fluent:RibbonTabItem>
    </Fluent:Ribbon>

</Fluent:RibbonWindow> 

我已经添加了点击事件上的流畅丝带按钮,像这样。

代码语言:javascript
复制
Class MainWindow 
    Private Sub btnClick(sender As Object, e As RoutedEventArgs)
        MsgBox("test")
    End Sub
End Class

但我明白这个错误。

代码语言:javascript
复制
Type 'Fluent.RibbonWindow' is not defined.
Type 'Fluent.Button' is not defined.
'btnClick' is not a member of 'TestRibbon.Fluent.Sample.Foundation.Window'. 

当我将Fluent.RibbonWindow改为Global.Fluent.RibbonWindowGlobal.Fluent.RibbonWindowFluent.Button时,它运行良好,过了一段时间,它再次显示了相同的错误,我不明白为什么这个错误发生了,'btnClick‘不是'TestRibbon.Fluent.Sample.Foundation.Window'.的成员

有人能帮我解决这个问题吗?谢谢。

EN

回答 1

Stack Overflow用户

发布于 2016-02-24 12:50:18

您是否尝试将下面的内容添加到您的参考资料中?查看https://github.com/fluentribbon/Fluent.Ribbon的演练。

代码语言:javascript
复制
<Ribbon:RibbonWindow.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <!--Attach Default Fluent Control's Theme-->
            <ResourceDictionary Source="/Fluent;Component/Themes/Generic.xaml" />
            <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Office2010/Silver.xaml" />
            <!--<ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/office2013/generic.xaml" />-->
        </ResourceDictionary.MergedDictionaries>                       
    </ResourceDictionary>        
</Ribbon:RibbonWindow.Resources>
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34382947

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档