2

I get this exception when I am adding the Ribbon control in a wpf application. Can someone give me some advice on how to get past it? In my xaml code the ribbon is added in the last tab as you can see on the code that follows. Everything was working normally and the problems started when I added the ribbon.

<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:v="clr-namespace:Views;assembly=DemoDataGrid"
Title="Testing GUI app" Width="1200" Height="768">
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Menu Margin="0" Grid.Row="0" VerticalAlignment="Top" Background="#FFEAF1FB">
        <MenuItem Header="File" IsTabStop="False">
            <MenuItem Header="Exit" Command="{Binding FileExit}" />
        </MenuItem>
        <MenuItem Header="Tools" IsTabStop="False"/>
        <MenuItem Header="Help" IsTabStop="False"/>
    </Menu>
    <ToolBarTray Grid.Row="1" Background="DarkGray"/>
    <UserControl Grid.Row="2" IsTabStop="False">
        <TabControl Margin="10,50,10,10">
            <TabItem Header="Date Picker">
                <Grid Background="#FFE5E5E5">
                    <v:DatePickerView/>
                </Grid>
            </TabItem>
            <TabItem Header="Color Picker">
                <Grid Background="#FFE5E5E5">
                    <v:ColorPickerView/>
                </Grid>
            </TabItem>
            <TabItem Header="Combo Box">
                <Grid Background="#FFE5E5E5">
                    <v:ComboBoxView/>
                </Grid>
            </TabItem>
            <TabItem Header="ExtendedDataGrid">
                <Grid Background="#FFE5E5E5">
                    <v:DGridXtendedView/>
                </Grid>
            </TabItem>
            <TabItem Header="RibbonMenu">
                <Grid Background="#FFE5E5E5">
                    <Ribbon/>
                </Grid>
            </TabItem>
        </TabControl>
    </UserControl>
    <StatusBar Grid.Row="3" VerticalAlignment="Bottom"  Background="#FFEAF1FB">
        <StatusBarItem Content="{Binding User}"/>
        <Separator />
        <StatusBarItem Content="{Binding Status}"/>
    </StatusBar>
</Grid>

18
  • 3
    Sounds like you're missing an assembly reference. Commented Mar 9, 2018 at 13:24
  • 3
    Can you show us some xaml code? Commented Mar 9, 2018 at 13:26
  • I edited the original post with xaml code Commented Mar 9, 2018 at 14:28
  • Do you use FsXAML? Commented Mar 9, 2018 at 19:59
  • Yes I use FsXAML. Commented Mar 12, 2018 at 10:38

1 Answer 1

2

1. Add reference to System.Windows.Controls.Ribbon

2. Add namespace to your xaml file

xmlns:ribbon="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon"
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.