question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ribbon button click event not working

See original GitHub issue

I am new in wpf. I want to try your Fluent ribbon that’s why downloaded it from Nuget and added it to my project. here is my code:

<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"/>
            <Fluent:Button Name="buttonGray" Header="Grey" Icon="Images\Gray.png" LargeIcon="Images\GrayLarge.png" Click="btnClick" />
        </Fluent:RibbonGroupBox>
    </Fluent:RibbonTabItem>
</Fluent:Ribbon>
 </Fluent:RibbonWindow>  

**MainWindow.xaml.vb**
Class MainWindow 
Private Sub btnClick(sender As Object, e As RoutedEventArgs)
    MsgBox("test")
End Sub
End Class

But i get this error.

Type 'Fluent.RibbonWindow' is not defined.
Type 'Fluent.Button' is not defined.
'btnClick' is not a member of 'TestRibbon.Fluent.Sample.Foundation.Window'.

when i change Fluent.RibbonWindow to **Global.Fluent.RibbonWindow _and same thing with _Fluent.Button it works well and after some time it again show the same error and i can’t understand why this error occurred ‘btnClick’ is not a member of ‘TestRibbon.Fluent.Sample.Foundation.Window’. I am using vs2013. Can you tell me if I have done anything wrong? Thanks

error

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
batzencommented, Dec 21, 2015

Ok, VB.NET seems to behave different. You need to use:

x:Class="MainWindow"
0reactions
batzencommented, Dec 22, 2015

That reference was, of course, wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Outlook Ribbon on Click Event not working
I have a simple Outlook Ribon button I am trying to create to forward a selected email to a set address. The probelm...
Read more >
A button in the command bar is not working correctly
Determine why a button is not working correctly. Several factors can cause a button action to fail. These include invalid ribbon customizations ......
Read more >
ValueChanged event not firing when clicking Button on ...
We have followed the issue at the point that we are certain that the ValueChanged event is not fired after the user as...
Read more >
how to click on ribbon button using javascript?
I want to trigger click for a ribbon button using Javascript. I used click() hence it did not triggered the event. $("#my.Ribbon.customTab.
Read more >
Ribbon button requires 2 clicks before function is invoked
The first time a ribbon button is clicked after an add-in is added to Excel or the page is reloaded, the function should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found