auto show seeker bar in media player framework - windows-8

I'm using Player Framework in my windows store app
http://playerframework.codeplex.com/
I want to use it only for audio files (no vide). Now I want that when user starts the track the bar with seeker, pause/play, volume is visible. I achived that when you move mouse over it and it will be shown it won't vanish. But I need to show it on start. How can i do that ?
It looks like this in my app
<mmppf:MediaPlayer Name="TrackPlayer" Width="400" Height="50" AudioCategory="BackgroundCapableMedia" AutoHideBehavior="None" IsDurationVisible="True" AutoHide="False" />

Just set IsInteractive="True":
<mmppf:MediaPlayer Name="TrackPlayer" Width="400" Height="50" AudioCategory="BackgroundCapableMedia" IsInteractive="True" IsDurationVisible="True" AutoHide="False" />

Related

Adding child elements to a HorizontalStackLayout causes "A cycle occurred while laying out the GUI" error

Im following allong the Youtube Series "Beyond Monkey" and on part 8, my XAML wont render at runtime (project compiles fine), hitting an error:
A cycle occurred while laying out the GUI.
Ive literally copied and pasted the code from the github repo to check its correct, but it still doesn't like it. I've pulled out bits of XAML everywhere until it builds and it seems it doesn't like the icon XAML:
<!-- Likes -->
<HorizontalStackLayout
Spacing="6"
VerticalOptions="Center">
<Image
Source="imglike.png"
WidthRequest="16"
HeightRequest="16" />
<Label
Style="{StaticResource RegularLightText14}"
Text="{Binding TheVideo.LikesCount, Mode=OneWay}" />
</HorizontalStackLayout>
If I strip the image and label out of the Horizontal Stack Layout it works, but as soon as I try to add any content to them, app.g.i.cs blows up with an unhandled exception
A cycle occurred while laying out the GUI.
Layout cycle detected. Layout could not complete.
The XAML looks ok to me and obviously works for the author, so I'm guessing is something unrelated that a XAML n00b like myself doesn't understand.
Anyone have any ideas?
Thanks

Xamarin Hot Reload does... Absolutely Nothing when Changes are Made

I'm creating a very UI centric application - in this application it is important (or event vital one can say) that I can actively preview my changes. Thankfully, Xamarin.Forms has Hot Reload - the perfect tool to get started to preview your changes!
I enabled hot reload in the 'Hot Reload' section in the options tab - I also enabled the 'Changes Made' (which is in preview) option to 'ON'.
I started my application - and I changed the text of a button... And...
Nothing.
I closed and reopened my app - and tried again... And... guess what?
Nothing.
Xamarin.Forms - come on!
This is a very annoying issue I've had on this specific application - it's taken away most of my day and I've just been fighting and fighting - and I have been unable to solve anything.
What I tried to do:
I tried to upgrade my Xamarin.Forms version to the latest - and that still did not solve anything.
I tried to enable and disable Hot Reload from the options menu - and that still did not solve anything.
I tried to close and reopen the solution - clean - and build - and you guess it: still I could not preview my changes.
I checked if I enabled it and it was enabled.
I checked my linker settings and they were as expected.
Images:
XAML code:
I changed the background color to blue:
<Grid HeightRequest="100"
Margin="5"
BackgroundColor="White"
RowSpacing="2">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="125" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0"
Grid.Column="1"
TextColor="Blue"
VerticalOptions="Center"
Text="{Binding EventTitle}"
Margin="7"
Padding="10,0" />
<Image Grid.Row="0"
HeightRequest="125"
VerticalOptions="Start"
Margin="2,2,1,2"
Aspect="AspectFill"
Source="{Binding Image}" />
</Grid>
My phone:
Even after saving - and waiting for at least half an hour - still the background is white.
I've tried everything possible to get it to work and I've been hitting the wall each time.
I am looking for help,
Thanks,
Tom
I've had all sorts of different issues with Hot Reload not working over the past few months.
I found the only consistent way that I could get it to work was by opening the project the long way around.
So:
Open Visual Studio
Choose Continue without code on the startup screen
Go to File -> Open -> Project/Solution and choose the solution from there.
Whenever I load the project this way, Hot Reload will work. If I load it any other way, it seems to be really temperamental.
Open project
Go to Tools => Debugging => Hot Reload
On "Common" section tick "Apply XAML hot reload on document save"
on "Xamarin.Forms" section tick "Full Page"
as shown in the image (red circled below).
On a project had the same issue , found out that i have to be in a XAML page
and not a XAML.CS page
Then hit save and it starts again and oke.
Common options - only Enable Just My XAML in Live Visual Tree
And in Xamarin.Forms option -Full page
ps
On your example it is White
BackgroundColor="White"

Button with Image Xamarin.Forms

I'm developing a cross pltform app with Xamarin.Forms. I want to make a button with an image but I dont know how to specify the path of the imge. When I use this annotation it works:
<Button Text="Naviga tra i Piani del Museo" Image="foo.png"/>
but when my image is inside some folders (folder1/folder2) the following code doesn't work:
<Button Text="Naviga tra i Piani del Museo" Image="folder1/folder2/foo.png"/>
So how can I correctly specify the path of my image?
You can't nest the images in folders. iOS and Android expect them to be resources, and WP expects them to be in the App's root folder.
The Xamarin Forms docs has a section on working with images.
Keeping the image common using PCL is a difficult task.
So do it separately.
Keep in mind that you have to copy the images to Resources>drawable in case of android project.
For using folders for Xamarin.Forms project this is what worked for me.
You need to put your resources (image file in this case), to folder inside Xamarin.Form project (for this example folder is called "Assets") and set Build Action "Content".
Secondly for resources to work with Android you need to put files to Resources>drawable folder inside Android project (here you cannot use any folders), Set Build Action "AndroidResource".
<ContentPage.Resources>
<ResourceDictionary>
<OnPlatform x:Key="StartButtonImage"
x:TypeArguments="FileImageSource"
Android="button_image.png"
WinPhone="Assets\button_image.png"
iOS="Assets/button_image.png"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Grid>
<Button Image="{StaticResource StartButtonImage}" BackgroundColor="Transparent"/>
</Grid>
</ContentPage.Content>
Pay attention that for iOs you need to make path using "/" and for WinPhone/UWP using "\".
You should specify Image property of button in OnPlatform tag to give different path for each platform. This is the example of Box View, you can try the same for Button Image property.
<BoxView HorizontalOptions="Center">
<BoxView.Color>
<OnPlatform x:TypeArguments="Color"
iOS="Green"
Android="#738182"
WinPhone="Accent" />
</BoxView.Color>
<BoxView.WidthRequest>
<OnPlatform x:TypeArguments="x:Double"
iOS="30"
Android="40"
WinPhone="50" />
</BoxView.WidthRequest>
</BoxView>

External Font Not Loading in Xaml

i tried to load a downloaded font in windows phone app.
i installed the font in pc.
i tried following
<TextBlock Width="237" Text="About" FontSize="36" Height="46" LineHeight="8"
FontFamily="{StaticResource nokia}"/>
<TextBlock Width="237" Text="About"
FontFamily="/font/nokia.ttf#Nokia Cellphone" FontSize="36" Height="46" LineHeight="8"/>
why external font is not loading
It doesn't matter if the font is installed on the PC or not.
For a font to work inside your app you'll need a few things.
You'll have to set the build action to 'Content' and output to directory set to: 'Copy if newer'.
And then the hardest part - Getting the preferred family right. I usually advocate using a tool for it, because the Windows Font viewer does not always show the right one.
'dp font viewer' is the one I usually use.
For a complete guide on implementing custom fonts, you could have a look here: http://www.blendrocks.com/code-blend/2015/01/04/a-complete-guide-to-working-with-custom-fonts-in-your-windows-and-windows-phone-app

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.