MediaElement XAML - xaml

I am trying to use the "AreTransportControlsEnabled=true" property of an MediaElement in order to get controls buttons.
I read that it was available on the windows phone 8.1
According to msdn
My project is for
Windows Phone Silverlight 8.1
I added this snippets of code to the MainPage.xaml:
<DrawingSurfaceBackgroundGrid x:Name="DrawingSurfaceBackground" Loaded="DrawingSurfaceBackground_Loaded">
<MediaElement
x:Name="VideoPlayer"
Source="test.mp4"
AutoPlay="False"
MediaEnded="OnMediaEnded"
Stretch="Fill"
/>
</DrawingSurfaceBackgroundGrid>
The problem is that when I add 'AreTransportControlsEnabled="true"'
<DrawingSurfaceBackgroundGrid x:Name="DrawingSurfaceBackground" Loaded="DrawingSurfaceBackground_Loaded">
<MediaElement
x:Name="VideoPlayer"
Source="test.mp4"
AutoPlay="False"
MediaEnded="OnMediaEnded"
Stretch="Fill"
AreTransportControlsEnabled=true
/>
</DrawingSurfaceBackgroundGrid>
AreTransportControlsEnabled isn't recognized or accessible and I can't build the application.
I can't find the reason.
Thanks in advance.

Related

Property 'Clip' does not support values of type 'EllipseGeometry'

In Windows Phone 8.1 I used 'EllipseGeometry' but it's not available in WinRT (or Universal app). Can anyone tell me it's alternative way
<Grid>
<Canvas Grid.Row="0" HorizontalAlignment="Center" x:Name="myCanvas" >
<Canvas.Clip>
<EllipseGeometry Center="114.5,114.5" RadiusX="114.5" RadiusY="114.5" />
</Canvas.Clip>
</Canvas>
</Grid>
The error is: Property 'Clip' does not support values of type 'EllipseGeometry'
My problem is that where should I look for an alternative of EllipseGeometry?
In my windows phone 8.1 App, I used following instead of EllipseGeometry, Worked.
<Ellipse>
<Ellipse.Fill>
<ImageBrush ImageSource="YourImage.png"/>
</Ellipse.Fill>
</Ellipse>

Windows Phone 8.1 xaml - read language resources from external project

I have portable library in which I have AppLocalizations.resw resource files. I can read it in the code behind (which is obsolete, but working):
new Windows.ApplicationModel.Resources.ResourceLoader("Assembly/AppLocalizations")
But how can I use it from the xaml? When I try to read it this way, the text is blank, even if the key in the resource file is Key.Text
<TextBlock x:Uid="Key" />
I was triying to import it in the App.xaml, but with no success.
Thanks.
I use this code with Windows Phone Universal Apps, but with a general resources:
<TextBlock Style="{StaticResource TextBlock_BlackStyle}" x:Uid="/Resources/txtIPName" Name="txtIPName" HorizontalAlignment="Left" Margin="33,149,0,0" TextWrapping="Wrap" Text="IP:" VerticalAlignment="Top"/>
Then if u had exertanl library, I think the code is:
<TextBlock x:Uid="/Assembly/AppLocalizations/Key" />
Tell me if I solve your problem! Good luck man! :)

Can't use Flyout in the Button in WinRT?

While using the Flyout in the Button as mentioned in the below code snippet,
<Button HorizontalAlignment="Center" Content="Open Flyout">
<Button.Flyout>
<Flyout>
//some code
</Flyout>
</Button.Flyout>
</Button>
It throws the following errors while building the app:
Unknown type 'Flyout' in XML namespace
http://schemas.microsoft.com/winfx/2006/xaml/presentation'
Unknown member 'Flyout' on element 'Button'
Note : It worked fine previously (a month before)
Vs2012 - Windows8.1
What am i missing? any help will be appreciated.
Thanks,
Joy Oyiess Rex K
The Flyout is a new control in Windows 8.1. You need Visual Studio 2013 to develop apps for Windows 8.1.

Unknown type 'AppBarButton' in XML namespace - Windows 8 Store App XAML, issues adding app bars

I'm new to developing Windows 8 apps, and am having trouble getting my XAML file to recognise generated code for adding AppBars and CommandBars.
I am getting the error "Unknown type [something] in XML namespace" for a number of elements I am trying to add, here is my example below:
If I re-open my solution this is temporarily displayed as a warning rather than an error. Also navigating to http://schemas.microsoft.com/winfx/2006/xaml/presentation just produces "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.".
This is all default code. my class namespace (e.g. MyApp.MainPage) matches the MainPage code behind namespace. I am at a loss and have been battling this for hours. I also intermittently changes from this error to 'InitializeComponent' does not exist in the current context". I have spent hours on XAML permissions errors in the past few days and don't want to waste any more time with errors in default generated code! :(
EDIT: I have tried this on three different machines, using both Windows 8 and Windows 8.1, both new projects and the existing project I have described in this post.
My guess is that you are using Visual Studio 2012 (Windows 8 apps). If so, you should use Button:
<Page.TopAppBar>
<AppBar>
<StackPanel Orientation="Horizontal">
<Button Style="{StaticResource AppBarButtonStyle}">A</Button>
<Button Style="{StaticResource AppBarButtonStyle}">B</Button>
</StackPanel>
</AppBar>
</Page.TopAppBar>
To use AppBarButton, you must use Visual Studio 2013 (Windows 8.1 apps):
<Page.TopAppBar>
<AppBar>
<StackPanel Orientation="Horizontal">
<AppBarButton>
<AppBarButton.Icon>
<FontIcon Glyph="A"/>
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton>
<AppBarButton.Icon>
<FontIcon Glyph="B"/>
</AppBarButton.Icon>
</AppBarButton>
</StackPanel>
</AppBar>
</Page.TopAppBar>
Also, CommandBars are only available in Windows 8.1.

Modifying FullScreen Design for ListPicker

I've Been working with WP7 for a while, am using listPicker/DatePicker Heavily. i hate its design though.i use liskPicker's property ExpansionMode="FullScreenOnly". i tried to make those controls to look prettier by
// Setting A source to the FullModeItemTemplate
FullModeItemTemplate="{StaticResource lpkFullItemTemplate}"
//the definition for this Resource is as follows:
<DataTemplate x:Name="lpkFullItemTemplate">
<StackPanel Orientation="Horizontal" Margin="5 5 5 5" Background="#FFA3A3A3"
Width="475" Height="45" >
<TextBlock Text="{Binding}" Foreground="Black" Margin="5 5 15 5" />
</StackPanel>
</DataTemplate>
I need real changes, changing the background of that popup and such changes, is that possible? or i need to build my own popup from scratch?
In order to do that you will have to create a copy of the ListPickerPage.xaml file from the Silverlight for Windows Phone Toolkit in your application, change it to meet your requirements, and then on your ListPicker control set the PickerPageUri proprety to the new ListPickerPage.xaml
I would like to improve Pedro's answer, but I still can't comment. You can see there's some people making questions up there.
In order to copy the ListPickerPage you'll need both the ListPickerPage.xaml and ListPickerPage.xaml.cs files. If you want those files to compile, you need some extension methods defined on Extensions.cs, ItemsControlExtensions.cs and VisualTreeExtensions.cs. You can either copy those three files or cherry pick the methods you need and add them to your own file.