2

I want to develop a app for the new Surface Neo by using the Uno Platform. For this I tried to implement a TwoPaneView in my MainPage.xaml, but it's not recognized properly. Also I downloaded the Uno.DualScreen NuGet package, but it didn't solve the problem.

With UWP only and WinUI 2.4 its working great, but unfortunately I can't use android/ios with this solution:

xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
...
<muxc:TwoPaneView/>

Does someone know how it works with correctly with the Uno Platform?

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
Matt126
  • 997
  • 11
  • 25

1 Answers1

1

I have used the TwoPaneView in an Uno Platform solution without problem. You need to update all the "head" projects to the latest pre-release version of the the Uno.UI package and then install the Microsoft.UI.Xaml nuget package in the UWP head. The TwoPaneView is implemented within both the Uno.UI and Microsoft.UI.Xaml packages (in the same namespace) and are conditionally compiled in. You shouldn't need to declare a specific namespace for the TwoPaneView and can simply use:

<Page
    x:Class="TwoPainView.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid Background="Green">
        <TwoPaneView Pane1Length="0.3*" Pane2Length="0.7*" Background="Yellow" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinWideModeWidth="100">
            <TwoPaneView.Pane1>
                <Border>
                    <Rectangle Fill="LightBlue" />
                </Border>
            </TwoPaneView.Pane1>
            <TwoPaneView.Pane2>
                <Border>
                    <Rectangle Fill="LightGreen"/>
                </Border>
            </TwoPaneView.Pane2>
        </TwoPaneView>
    </Grid>
</Page>

I have a GitHub repository here which I used to report this issue to Uno. It uses the TwoPaneView and runs fine on both UWP and Android (should work on iOS but I don't have an iOS device to test) so might help get you started.

Hope it helps.

ibebbs
  • 1,963
  • 2
  • 13
  • 20
  • Thank you, now its working! I can run the app and everthing works fine. Unfortunately the error still remains in XAML. It says that TwoPaneView was not found, do you have any clue? – Matt126 Apr 02 '20 at 18:30