Can't use Flyout in the Button in WinRT? - xaml

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.

Related

How do I customize the content and location of a tooltip using Syncfusion in Xamarin?

I'm setting up a stacking column chart in XAML using Syncfusion for Xamarin in Visual Studio 2017. I've tried adding custom text according to the example here, but I run into an exception when the tooltip is activated. Here's the code I'm using:
<chart:SfChart.Series>
<chart:StackingColumnSeries EnableTooltip="True"
Width="0.5"
ItemsSource="{Binding TankLevels}"
XBindingPath="Name" YBindingPath="Level1">
<chart:StackingColumnSeries.TooltipTemplate>
<DataTemplate>
<StackLayout>
<Label Text="test"></Label>
</StackLayout>
</DataTemplate>
</chart:StackingColumnSeries.TooltipTemplate>
<chart:BarSeries.ColorModel>
<chart:ChartColorModel Palette="Custom" CustomBrushes="{Binding WaterColor}">
</chart:ChartColorModel>
</chart:BarSeries.ColorModel>
</chart:StackingColumnSeries>
I have analyzed your code snippet and prepared a sample based on it, and the sample can be downloaded from the link below.
Sample: 215585
I am afraid I was not able to reproduce the reported issue, it is working fine. Can you please provide more information like a stack trace on the exception?
Thanks,
Michael
Note: I work for Syncfusion
The issue was that I was using an outdated version of Syncfusion's Xamarin Controls. I didn't have any more issues after updating to the newest version.

Conditional XAML causes XBF generator error

I am trying to set the Icon property of MenuFlyoutItem on the UWP. As this is only available in contract version 4, I wanted to use conditional XAML statements in form of the IsApiContractPresent statement. Doing this, I came up with this code:
<MenuFlyout>
<MenuFlyoutItem Text="Open">
<contract4Present:MenuFlyoutItem.Icon>
<FontIcon Glyph=""/>
</contract4Present:MenuFlyoutItem.Icon>
</MenuFlyoutItem>
</MenuFlyout>
and added this line in the definition of my page:
xmlns:contract4Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,5)"
Sadly, Visual Studio is now not able to compile the project anymore, with this error message:
The XAML Binary Format (XBF) generator reported syntax error '0x09C4' : Property Not Found
Strangely, the same errors comes up, when I use the minimal example given in the documentation
<TextBlock contract5NotPresent:Text="Hello, World"
contract5Present:Text="Hello, Fall Creators Update"/>
How can I solve this error? Or is this even a bug of Visual Studio?
Apparently, this functions is only available for Minimum Build versions > 15063. Otherwise, you must use version adaptive code, and not XAML.

Use icon fonts in Windows Universal apps

Since Windows 10 has .NET introduced the property FontIcon.Glyph. If you add code below to your xaml page if gives me next char Σ.
<FontIcon FontFamily="Candara" Glyph="Σ"/>
So I was thinking can you add an other icon font like Font Awesome or Icomoon info your project?
I've download a font, added into my solution and I use this code:
<FontIcon FontFamily="ms-appx:/Fonts/FontAwesome.otf#FontAwesome" Glyph="" Foreground="Black"/>
what results into this:

MediaElement 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.

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.