Xamarin.Forms WPF won't load VideoView - wpf

I try to recreate the Xamarin.Forms libvlcsharp Sample for myself.
On Android an iOS it works perfectly fine, but when i try to use the Xamarin.Forms WPF Implementation it won't even load the ContentPage any more.
As soon as i remove the VideoView from the ContentPage and replace it with an Label or something like that it works.
In this case it works:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AwsomeSample"
xmlns:shared="clr-namespace:LibVLCSharp.Forms.Shared;assembly=LibVLCSharp.Forms"
x:Class="AwsomeSample.MainPage">
<!--<shared:VideoView x:Name="videoView" HorizontalOptions="Center" VerticalOptions="Center"/>-->
<Label Text="Bool11"/>
</ContentPage>
And here not:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AwsomeSample"
xmlns:shared="clr-namespace:LibVLCSharp.Forms.Shared;assembly=LibVLCSharp.Forms"
x:Class="AwsomeSample.MainPage">
<shared:VideoView x:Name="videoView" HorizontalOptions="Center" VerticalOptions="Center"/>
<!--<Label Text="Bool11"/>-->
</ContentPage>
Hope my english isn't that bad. ^^

From https://code.videolan.org/videolan/LibVLCSharp/issues/38, this has been fixed:
Try with (at least) https://www.nuget.org/packages/LibVLCSharp.WPF/0.0.1-alpha2 and https://www.nuget.org/packages/LibVLCSharp.Forms.WPF/0.0.1-alpha1
I believe you can close this question now.

Related

Xamarin forms ToolbarItems WPF secondary

I have this code to set up toolbar items in XAML.
<ContentPage.ToolbarItems>
<ToolbarItem Name="Menu1" Activated="OnClick" Order="Primary" Priority="{StaticResource Priority1}" />
<ToolbarItem Name="Menu2" Activated="OnClick" Order="Secondary" Priority="{StaticResource Priority2}" />
</ContentPage.ToolbarItems>
The rendering is fine in Android , but in WPF I see an ugly square icon (is a placeholder for a missing icon?)
Any ideas?
WPF render example
Android render example
Try adding an icon for the Toolbaritem in the Assets folder.
Also, try updating the Xamarin.Forms version - with version 3.3.0.967583 I can not observe placeholder icons.
Please note that the Name and Activated properties are obsolete - use Text and Clicked, respectively:
<ToolbarItem Text="Menu1"
Icon="{OnPlatform WPF=Assets/menu1.png}"
Order="Primary"
Clicked="OnToolbarItemClicked" />
<ToolbarItem Text="Menu2"
Icon="{OnPlatform WPF=Assets/menu2.png}"
Order="Secondary"
Clicked="OnToolbarItemClicked" />

RibbonSplitButton cannot locate resource

I have a RibbonSplitButton that contains a SmallImageSource like so:
<UserControl x:Class="myProgram/toolbars/MainToolbar">
<RibbonSplitButton SmallImageSource="/Images/Undo.png"/>
<!-- more buttons-->
</UserControl>
I try to use this in another file (main):
<UserControl x:Class="myProgram/main"
xmlns:toolbar="clr-namespace:myProgram.toolbars">
<toolbar:MainToolbar/>
</UserControl>
I get the error message in main:
Cannot locate resource 'images/undo.png'
However, when I switch to a normal button:
<Button>
<Image Style="{StaticResource buttonstyle}">
<Image.Source>
<BitmapImage DecodePixelWidth="40" UriSource="/Images/Undo.png"/>
</Image.Source>
</Image>
</Button>
the error is gone. I have tried using Pack URIs, changing the Build Action to Resource and Embedded Resource, as well as Clean Soultion, Rebuild Solution, Restarting Visual Studios (rinse and repeat). I image this has something to do with the RibbonSplitButton's image source, but I have no idea. The program runs fine (the Undo.png image shows and works perfectly), it's just annoying to have the error in my developer. Anyone have suggests on how to get rid of the error? (Note, this is a simplified folder structure, for example purposes).
EDIT
For anyone who ends up here at some point in the future, I found that this answer worked.

Having difficulty using Z-Index in WPF

I've followed some examples trying to layer a rectangle over the WebBrowser object:
Here is the MSDN example link. (I got it to work)
Layers issue using Z-Index
Here is the code I'm trying to get to work:
<Grid>
<Canvas Margin="2,4,0,-450" >
<Rectangle Height="452" Canvas.ZIndex="1000" Name="rectangle1" Stroke="Black" Width="524" Opacity=".5" Fill="#8CBABABA" Canvas.Top="-7" Canvas.Left="-3" />
<WebBrowser Name="mapBrowser" Canvas.ZIndex="999" Margin="5,5,5,5" Height="452" Width="516" Canvas.Top="-11" />
</Canvas>
</Grid>
I'm trying to make the WebBrowser appear grayed out by making the rectangle appear over top of it. I'll also disable it.
Can anybody point to what I'm doing wrong?
I solved this issue by creating a .png image which I placed in the same space as the webbrowser. It looks like a grayed-out version of what first appears in the webbrowser. Then I conditionally hid the webbrowser which makes the image visible. This is the only way I've found to make it work using .Net 4.0.

Silverlight toolkit transition stopping half way when the application is reactivated

I'm using the nov 11 silverlight toolkit, and I just copy pasted the basic transitions to spice up my app a bit without doing much work. I'm referring to this code:
<!--some really simple basic navigation animations to get us started-->
<toolkit:TransitionService.NavigationInTransition>
<toolkit:NavigationInTransition>
<toolkit:NavigationInTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardIn"/>
</toolkit:NavigationInTransition.Backward>
<toolkit:NavigationInTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardIn"/>
</toolkit:NavigationInTransition.Forward>
</toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
<toolkit:TransitionService.NavigationOutTransition>
<toolkit:NavigationOutTransition>
<toolkit:NavigationOutTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardOut"/>
</toolkit:NavigationOutTransition.Backward>
<toolkit:NavigationOutTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardOut"/>
</toolkit:NavigationOutTransition.Forward>
</toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>
This works great, except for when I am reactivating the application after it has been tombstoned. It appears that the transition stops halfway through. The application remains responsive, but looks completely messed up. Like this:
Does anyone have any idea how to solve this? I think it might have something to do with my viewmodel and that it gets populated during the transition... So if that's the case, is there an event I can subscribe to for when the transition is done? then I can unsupress the property changed event in my viewmodel. But the transition works perfectly when I'm just navigating around my app, so that probably isn't it.
Any ideas would be much appreciated.
Try this code: http://blog.rsuter.com/?p=74
You can define multiple transitions in App.xaml:
<Application.Resources>
<ResourceDictionary>
<Style x:Key="Transition" TargetType="phone:PhoneApplicationPage">
...
</Style>
<Style x:Key="Transition2" TargetType="phone:PhoneApplicationPage">
...
</Style>
<Style x:Key="Transition3" TargetType="phone:PhoneApplicationPage">
...
</Style>
</ResourceDictionary>
</Application.Resources>
And set the transition for each page:
In page 1:
<phone:PhoneApplicationPage ... Style="{StaticResource Transition}">
In page 2:
<phone:PhoneApplicationPage ... Style="{StaticResource Transition2}">
In page 3:
<phone:PhoneApplicationPage ... Style="{StaticResource Transition3}">
Have you tried moving the resource declaration to the page?
Something like this:
<phone:PhoneApplicationPage x:Name="MyPage">
<phone:PhoneApplicationPage.Resources>
<Style x:Key="LocalTransition">
...
</Style>
</phone:PhoneApplicationPage.Resources>
</phone:PhoneApplicationPage>
C# code behind:
public class MyPage
{
public MyPage()
{
InitializeComponent();
Style = (Style)Resources["LocalTransition"];
}
}

wpf ribboncontrol QAT

When using Ribboncontrol october 2010 release from Microsoft, even if I don't use QAT I get a right click event "show quick access toolbar" (which doesn't do anything). How can this be disabled ?
Unfortunately the following does not do the task:
<r:Ribbon x:Name="Ribbon"
Title="title" IsMinimized="False">
<r:Ribbon.ApplicationMenu>
<r:RibbonApplicationMenu Visibility="Collapsed"/>
</r:Ribbon.ApplicationMenu>
<r:Ribbon.QuickAccessToolBar>
<r:RibbonQuickAccessToolBar Visibility="Collapsed" />
</r:Ribbon.QuickAccessToolBar>
...
Take care that the context-menu also does not disapear, when you have disabled all other features of the ribbon.
Sorry, I thought I solved the problem some time ago, but actually I didn't.

Resources