Problem in Windows 8 Phone: Error 2 SlideView is not supported in a Silverlight project

I had several problems trying to implement a sliding menu (for example, "Facebook") in a Windows Phone 8 application.

When I added the following code in app.xaml, it shows the following problems

<Application.RootVisual>
            <library:SlideApplicationFrame Header="ManageIT"
                                       Background="White">
                <!--<library:SlideApplicationFrame.LeftContent>
                <pages:LeftView />
            </library:SlideApplicationFrame.LeftContent>-->
                <!--<library:SlideApplicationFrame.RightContent>
                <pages:RightView />
            </library:SlideApplicationFrame.RightContent>-->
            </library:SlideApplicationFrame>
        </Application.RootVisual>

An exception is given below.

Error   1   Nested properties are not supported: Application.RootVisual.
Error   2   The attachable property 'RootVisual' was not found in type 'Application'.
Error   3   Unexpected PROPERTYELEMENT in parse rule PropertyElement ::= . PROPERTYELEMENT Content? ENDTAG..

Can someone help me solve this problem? Is it because the reference to System.Windows.UIElement is not executed?

Update 1

I canceled the above change and add the following to mainpage.xaml after installing the slide show using the package manager console

SlideView Installation Package

Here is the code ...

<controls:SlideView>

            <Grid Background="Teal"
            Width="400" />

            <Grid Background="Tomato" />

            <Grid Background="LightYellow" />

            <Grid Background="YellowGreen"
            Width="400"/>

        </controls:SlideView>

But I have another set of build errors, as shown below.

Error 1 The control namespace prefix is ​​not defined.

2 SlideView Silverlight.

3 " " .

4 type 'controls: SlideView' . , .

2

, , ...

System.InvalidOperationException was unhandled by user code
  HResult=-2146233079
  Message=Operation is not valid due to the current state of the object.
  Source=Microsoft.Phone
  StackTrace:
       at Microsoft.Phone.Controls.PhoneApplicationFrame..ctor()
       at slidingmenu.App.InitializePhoneApplication()
       at slidingmenu.App..ctor()
  InnerException: 

Sebastian

+4
3

xml?

    xmlns:controls="clr-namespace:SlideView.Library;assembly=SlideView.Library"
    xmlns:slideview3="clr-namespace:slideview3"

LeftView .

    <library:SlideApplicationFrame.LeftContent>
        <slideview3:LeftView />
    </library:SlideApplicationFrame.LeftContent>
0

, StackPanel. , . ? . CodePlex SlideView. , .

0

I had the same problem in my (MvvmCross-) application.

I was able to solve this problem by creating RootFrame code in App.xaml.csinstead of adding it to Xaml:

    private void InitializePhoneApplication()
    {
        var slideApplicationFrame = new SlideApplicationFrame
            {
                LeftContent = new LeftView(), 
                RightContent = new RightView()
            };

        this.RootFrame = slideApplicationFrame;
        this.RootVisual = this.RootFrame;

        this.RootFrame.Navigated += this.CompleteInitializePhoneApplication;

        // Handle navigation failures
        this.RootFrame.NavigationFailed += this.RootFrameNavigationFailed;
    }

... and deleted everything <Application.RootVisual>...</Application.RootVisual>in App.xaml.

0
source

Source: https://habr.com/ru/post/1547370/


All Articles