I have created code to show image in panorama page. There is designer of that page showing but when i execute the program with my emulator or on my windows phone 8 they both are doesn't showing that images. Images are edited in paint. what is the resolution to show image perfectly in grid ??
my code is:
<controls:PanoramaItem >
<Grid Margin="0,-120,0,0">
<Image HorizontalAlignment="Left" Height="612" VerticalAlignment="Top" Width="420" Source="/HubTilesPanorama;component/powers.jpg" Margin="0,102,0,0" />
</Grid >
</controls:PanoramaItem>
Related
i have the following main view
<NavigationView AlwaysShowHeader="True">
<NavigationView.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Trxto" />
</StackPanel>
</DataTemplate>
</NavigationView.HeaderTemplate>
<NavigationView.Content>
<TextBlock Text="Content" />
</NavigationView.Content>
</NavigationView>
If i run this while targeting Windows 10 1803 i can see the header, but if i
change the target version to 1903 it doesn't show up....
So, I'm lost here, any help would be appreciate
UWP NavigationView.HeaderTemplate not working on 1903
The problem is that you just implement HeaderTemplate, but you have not set Header property. the HeaderTemplate will not render.
NavigationView. <NavigationView AlwaysShowHeader="True" Header="Test">
I have several images with the png extension in my project where in android and ios they appear correct, already in universal windows they do not appear. I made the test the following I changed one of the images to jpg and funcionol, appeared my image in universal windows. Will I have to change all the images? Or do you have a way to solve this so that my images will be PNG?
An example of how I call the pictures ...
<StackLayout Orientation="Horizontal">
<Image Source="facebook.png" HeightRequest="25" WidthRequest="25"/>
<Image Source="twitter.png" HeightRequest="25" WidthRequest="25"/>
<Image Source="whatsapp.png" HeightRequest="25" WidthRequest="25"/>
</StackLayout>
Most likely URI resolution fails, you should really follow documentation's guidelines when it comes to working with embedded images.
Take a look at the photo, Visual Studio 2013 (as well as Blend) designer shows different rendering than on actual Windows Phone 8.1 device (Lumia 930):
Look at the red backgrounds widths: designer shows it like left aligned, but device renders as stretch.
The questions are: why and what causes this problem and how to fix it or workaround?
Sample project.
Gist:
<Page.Resources>
<SampleData:SampleDataSource x:Key="SampleDataSource" d:IsDataSource="True"/>
<DataTemplate x:Key="TestItemTemplate">
<Border Background="#FFA20F00">
<TextBlock Text="{Binding Property1}" Style="{ThemeResource ListViewItemTextBlockStyle}" />
</Border>
</DataTemplate>
</Page.Resources>
<Grid DataContext="{Binding Source={StaticResource SampleDataSource}}">
<ItemsControl ItemTemplate="{StaticResource TestItemTemplate}" ItemsSource="{Binding TestCollection}"/>
</Grid>
Found workaround:
<ItemsControl ItemTemplate="{StaticResource TestItemTemplate}" ItemsSource="{Binding TestCollection}">
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter"/>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
It seems to be a bug in the VisualStudio. Here's the MS Connect bug report.
It might be that Visual Studio just has a different template than what is actually on the device for some reason. Try setting the alignment of the itemcontainer manually by adding an ItemContainerStyle to your ItemsControl.
Depending on what you want to do, change the value of the setter. Set it to left to mimic the behavior in Visual Studio, or Stretch to make it look like it is on the device.
<ItemsControl ItemTemplate="{StaticResource TestItemTemplate}"
ItemsSource="{Binding TestCollection}">
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="HorizontalAlignment" Value="Stretch" />
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
i am very new to window phone application development. i have just write a simple code of button click.but when i try to run it, it shows error like "Device is not connected" but when i connected to internet my application run. is it essential to connected to the internet to run my application.
i don't have window phone.
i have just downloaded the window sdk 7.0 which automatically installed window phone emulator.
i don't have window phone . what should i do ?
this is my code
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Button Name="_playaudio" Height="80" Width="150"
HorizontalAlignment="Left" VerticalAlignment="Top" Click="_playaudio_Click">
<Button.Background>
<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
<GradientStop Color="#FFDB2422" Offset="0.36" />
<GradientStop Color="#FFAD3A3A" Offset="1" />
</LinearGradientBrush>
</Button.Background> Click Me
</Button>
<MediaElement x:Name="mymedia" VerticalAlignment="Bottom" Source="/assest/Audio/Animals/Lion.wav" Volume="100" AutoPlay="False" >
</MediaElement>
No, you don't have to be connected to any network in order to make it run.
The error you get is due to the debug device you selected.
On the top bar of Visual Studio there is a button with a green triangle on it, on the right you probably see the caption "Device". Use the dropdown menu to select an emulator instead of the phisical device. When you hit on the button, the emulator will open, the app will be installed and then will be launched.
You dont require internet or physical device to build or debug application. Make sure the targetted debug platform is emulator and not the device. That should solve the issue.
I put my adcontrol control to my page. While using test unitid and test appid the ads show up. When I type my app ID and normal adunitid anything shows up in emulator. Place where ad should be visible is transparent.
one more q; how can I "pin" my ad to scroll at the bottom of the screen with scrollviewer?
When I type my app ID and normal adunitid anything shows up in emulator
Many ad-providers are able to detect the emulator and turn off the ads. Deploy to a real device to test them.
how can I "pin" my ad to scroll at the bottom of the screen with scrollviewer?
Just change the layout of your page and put the adcontrol outside of the scrollviewer. For instance:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="0">
<!-- Whatever -->
</ScrollViewer>
<AdControl Grid.Row="1" AdUnit="..." />
</Grid>
To find out what is the problem with the Ad control, register to the AdControlError event and look at the e.ErrorCode and e.ErrorDescription.
I don't think that "pinning" the ad control at the bottom of a ScrollViewer is a good idea. You'd better place both the ScrollViewer and the AdControl inside a Grid with two rows.