Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

name metrowindow does not exist?

Tags:

c#

wpf

I face an error The name metroWindow does not exist in the namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" i do not know where is the problem i also check mahapps replaced by NuGet but still same problem i am currently using VS2012. I already checked few stack ov erflow question but problem still exist.

<controls:MetroWindow
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
       
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="DTWGestureRecognition.MainWindow"
        
        Title="Kinect Sign Language Translator" Height="900" Width="1500" Loaded="WindowLoaded" Closed="WindowClosed" Background="White">
    <Viewbox Height="768" VerticalAlignment="Top" Width="1366">
        <Border>
            <Grid Height="186" Width="2000">
                <TabControl x:Name="tabControl" Margin="-59,0,461,0">


                    <TabItem Header="Intro">
                        <Grid Margin="0,0,-527,-1053">
                            <Grid.Background>
                                <ImageBrush ImageSource="elisabet2.png"/>
                            </Grid.Background>
                        </Grid>
                    </TabItem>
                    <TabItem Header="Gesture Detection">



                        <Grid Margin="0,0,-527,-1053" Background="White">
                            <Canvas x:Name="skeletonCanvas" Background="Black" ClipToBounds="True" Margin="293,256,1186,456" Height="480"  Width="640" />
                            <Image x:Name="videoImage" Margin="953,256,526,456" Width="640" Height="480" />
                            <Image x:Name="depthImage" Grid.Column="1" HorizontalAlignment="Left" Height="12" Margin="1416,730,0,0" Grid.Row="1" VerticalAlignment="Top" Width="40" IsEnabled="False"/>






                            <StackPanel Margin="1615,257,18,691">
                                <ComboBox x:Name="gestureList" Width="486" HorizontalAlignment="Center" Height="50" Background="#FF455A64" FontSize="24" FontFamily="Arial" Foreground="White">
                                    <ComboBoxItem IsSelected="True" Content="@from"/>
                                    <ComboBoxItem Content="@go there"/>
                                    <ComboBoxItem Content="@good"/>
                                    <ComboBoxItem Content="@happy"/>
                                    <ComboBoxItem Content="@Hello."/>
                                    <ComboBoxItem Content="@in"/>
                                    <ComboBoxItem Content="@me"/>
                                    <ComboBoxItem Content="@out"/>
                                    <ComboBoxItem Content="@Please"/>
                                    <ComboBoxItem Content="@school"/>
                                    <ComboBoxItem Content="@Thank you"/>
                                    <ComboBoxItem Content="@today"/>
                                    <ComboBoxItem Content="@understand"/>
                                    <ComboBoxItem Content="@what"/>
                                    <ComboBoxItem Content="@where"/>
                                    <ComboBoxItem Content="@wrong"/>
                                    <ComboBoxItem Content="@yes"/>
                                    <ComboBoxItem Content="@you"/>
                                    <ComboBoxItem Content="@your"/>
                                </ComboBox>
                                <TextBox FontSize="24" x:Name="results" Focusable="False" BorderThickness="0" Text="" TextAlignment="Left" VerticalAlignment="Top" Height="65" Foreground="White" Background="#FF455A64" FontFamily="Arial"  />
                                <TextBox FontSize="24" x:Name="status" Focusable="False" BorderThickness="0" Text="" TextAlignment="Left" VerticalAlignment="Top" Height="65" Foreground="White" Background="#FF455A64" FontFamily="Arial" />
                                <TextBox FontSize="24" x:Name="currentBufferFrame" Focusable="False" BorderThickness="0" Text="" TextAlignment="Left" VerticalAlignment="Top" Height="65" Foreground="White" Background="#FF455A64" FontFamily="Arial" />
                            </StackPanel>


                            <StackPanel Margin="0,259,1838,452">
                                <Button x:Name="dtwRead" Content="Read" Click="DtwReadClick" Width="200" IsEnabled="False" Background="#FF455A64" Foreground="White" Height="65" FontSize="18.667"/>
                                <Button x:Name="dtwCapture" Content="Capture" Click="DtwCaptureClick" Width="200 " Background="#FF455A64" Height="65" FontSize="18.667" Foreground="White"/>
                                <!-- <Button x:Name="dtwShowGestureTest" Content="Show Gesture Text" IsEnabled="True" Click="DtwShowGestureText" Width="200"  /> -->
                                <Button x:Name="dtwStore" Content="Store" IsEnabled="False" Click="DtwStoreClick" Width="200" Background="#FF455A64" Height="65" FontSize="18.667" Foreground="White" />
                                <Button x:Name="dtwLoadFile" Content="Load gesture file" IsEnabled="True" Click="DtwLoadFile" Width="200" Margin="40,0,41,0" Height="65" Background="#FF455A64" Foreground="White" FontSize="18.667" />
                                <Button x:Name="dtwSaveToFile" Content="Save to file" IsEnabled="True" Click="DtwSaveToFile" Width="200" Margin="40,0,41,0" Height="65" Background="#FF455A64" Foreground="White" FontSize="18.667" />
                            </StackPanel>


                            <TextBox FontSize="18.667" x:Name="dtwTextOutput" Margin="1615,646,17,0" Focusable="True" BorderThickness="0" Text="" TextAlignment="Left" HorizontalAlignment="Center" VerticalAlignment="Top" Width="487" Height="414" VerticalScrollBarVisibility="Auto" IsReadOnly="True" IsEnabled="False" BorderBrush="Black" Background="White" Foreground="White" />


                            <TextBox x:Name="textBox2" Margin="293,915,526,132" TextWrapping="WrapWithOverflow" FontSize="32" Background="Black" OpacityMask="{x:Null}" VerticalContentAlignment="Center" BorderBrush="#FF7C2020" IsReadOnly="True" Foreground="White" />



                            <Label x:Name="label1_Copy" Content="COORDINATES" HorizontalAlignment="Left" Margin="1615,603,0,0" VerticalAlignment="Top" Width="486" FontSize="21.333" FontStyle="Italic" HorizontalContentAlignment="Center"/>

                            <Label x:Name="label_Copy1" Content="GESTURE SELECTOR" HorizontalAlignment="Left" Margin="1615,208,0,0" VerticalAlignment="Top" Width="486" FontSize="21.333" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontStyle="Italic"/>


                            <Label x:Name="label2" Content="SIGNS TRANSLATOR" HorizontalAlignment="Left" Margin="817,50,0,0" Width="494" VerticalAlignment="Top" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="26.667" FontStyle="Italic"/>

                            <Label x:Name="label" Content="SKELETON VIEW" HorizontalAlignment="Left" Margin="293,218,0,0" VerticalAlignment="Top" Width="640" FontSize="21.333" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontStyle="Italic" RenderTransformOrigin="0.702,0.503"/>
                            <Label x:Name="label_Copy" Content="COLOR VIEW" HorizontalAlignment="Left" Margin="953,218,0,0" VerticalAlignment="Top" Width="640" FontSize="21.333" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" FontStyle="Italic"/>
                            <Label x:Name="label1" Content="OUTPUT" HorizontalAlignment="Left" Margin="423,872,0,0" VerticalAlignment="Top" Width="1082" FontSize="21.333" FontStyle="Italic" HorizontalContentAlignment="Center"/>





                        </Grid>


                    </TabItem>
                    <TabItem Header="Text Detection">
                        <TabItem.Background>
                            <ImageBrush/>
                        </TabItem.Background>

                        <Grid Margin="0,0,-527,-1053">
                            <Grid.Background>
                                <ImageBrush ImageSource="website-under-construction.png" Stretch="Uniform"/>
                            </Grid.Background>
                        </Grid>


                    </TabItem>
                    <TabItem Header="Tutorial">
                        <TabItem.Background>
                            <ImageBrush/>
                        </TabItem.Background>
                        <Grid Margin="0,0,-527,-1053">
                            <Grid.Background>
                                <ImageBrush ImageSource="website-under-construction.png" Stretch="Uniform"/>
                            </Grid.Background>
                        </Grid>
                    </TabItem>
                    <TabItem Header="About Us">
                        <TabItem.Background>
                            <ImageBrush/>
                        </TabItem.Background>
                        <Grid Margin="0,0,-527,-1053">
                            <Grid.Background>
                                <ImageBrush ImageSource="website-under-construction.png" Stretch="Uniform"/>
                            </Grid.Background>
                        </Grid>
                    </TabItem>
                </TabControl>

            </Grid>

        </Border>
    </Viewbox>



</controls:MetroWindow>
like image 515
Marina Avatar asked Oct 14 '16 04:10

Marina


2 Answers

On my side, with the basic install of MahApps nuget it worked out. So, the code is not the problem. Try to uninstall the MapApps nuget, and install it again or run in the Package Manager Console the following command :

Install-Package MahApps.Metro -Version 1.3.0

Remember, is not your code, it is about your configuration. If the update didn't solve the problem, try to remove any style that may cause problems. It is also possible to be a style problem.

like image 110
Dragos Stoica Avatar answered Nov 07 '22 06:11

Dragos Stoica


I know it is late,

but for me only the change of the xmlns helped.

xmlns produces same error as described:

xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls"

xmlns that works for me (same as you use):

xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
like image 28
WPFGermany Avatar answered Nov 07 '22 05:11

WPFGermany