I am trying to display a browser in a ViewBox element on a Windows Phone 8 Nokia Lumia.
The WebBrowser is displaying when it is alone, but when I put it in a ViewBox element, it does not show.
Here is my sample code:
<phone:PhoneApplicationPage
x:Class="PhoneApp2.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Viewbox Stretch="Fill" >
<phone:WebBrowser Source="http://google.com" />
</Viewbox>
</phone:PhoneApplicationPage>
hey the problem is the default height and width of viewbox control..just set the height and width of your view box control ..like this it will work..
<Viewbox Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Left">
<phone:WebBrowser Grid.Row="0" Height="800" Source="http://www.google.com" Width="500" />
</Viewbox>
any query..comment below..
Related
I build a SSRS report. In both edit and preview mode it show the headers for the columns in normal non bold. However when I run the same SSRS report from our report server the header text shows up as bold. I tried removing the report multiple times. I tried clearing my internet cache and nothing. Any ideas?
Update: I uploaded same report(With changes) to server but with different name and everything is the same on the report.
Update 2: I show NO cache on for the reports. I tried rebooting the server that has both SSRS and SQL running on it and no change. Thinking it may be within the report but after checked I do not see anything that would cause it.
Update 3 for Jerry:
<TablixCell>
<CellContents>
<Textbox Name="nop123">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Number of Parts</Value>
<Style>
<TextDecoration>None</TextDecoration>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<Style>
<Border>
<Color>LightGrey</Color>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<WritingMode>Rotate270</WritingMode>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
I've got some TextBlock in my wp8 app which have the same style: for example, they all need to be underlined, bold and something else..
Is there the possibility to centralize this common style without repeating all style's declarations for each TextBlock in my application?
Could you give me some working example?
Thanks in advance!
In App.xaml resources you can define global styles for all pages. If you want to have the same style for all TextBlock, the style has to contain only TargetType, but not x:Key.
<Application.Resources>
<ResourceDictionary>
<!-- All TextBlock(s) -->
<Style
TargetType="TextBlock">
<Setter
Property="FontSize"
Value="{StaticResource PhoneFontSizeExtraLarge}" />
<Setter
Property="FontWeight"
Value="Bold" />
<!-- something else -->
</Style>
</ResourceDictionary>
</Application.Resources>
In my windows phone 8 application, I want to open a page in web browser.
For that I have taken WebBrowser.
<Grid x:Name="ContentPanel" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0">
<phone:WebBrowser x:Name="addComBrowser" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" MinWidth="480" MinHeight="796" />
</Grid>
Now in the code behind file I've set the url.
Uri uri = new Uri("http://blablabla.....");
addComBrowser.Source = uri;
Now when I run the app, The content in the browser displaying in very small size.
Below is the output.
How should I increase the font size of how should i increase the zoom level.
Thanks.
If you can change the HTML maybe you can add the viewport metadata:
https://developer.mozilla.org/en/Mobile/Viewport_meta_tag
Insert this in between <head> and </head> in your html
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
I am try to make image gray-scale work on IE 10, after some search use svg can archive it, but now I meet another problem, here is the code make image gray-scale work on IE 10
<svg xmlns="http://www.w3.org/2000/svg" id="svgroot" viewBox="0 0 400 377" width="400" height="377">
<defs>
<filter id="filtersPicture">
<feComposite result="inputTo_38" in="SourceGraphic" in2="SourceGraphic" operator="arithmetic" k1="0" k2="1" k3="0" k4="0" />
<feColorMatrix id="filter_38" type="saturate" values="0" data-filterid="38" />
</filter>
</defs>
<image filter="url("#filtersPicture")" x="0" y="0" width="400" height="377" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://thecybershadow.net/misc/stackoverflow.png" />
</svg>
the problem is the image not scale by size I give, for example, if the image's size is 200 X 1000 and I give the size 200 X 500, it will scale the image to something like 100 X 500
I tried preserveAspectRatio http://www.w3.org/TR/SVG/coords.html#PreserveAspectRatioAttribute seem not work
so my question is how to make the image resize to the size I given?
thanks in advance
If you want the image to stretch to fill the width and height you specify exactly (horizontally and vertically), use preserveAspectRatio="none".
<image x="0" y="0" width="400" height="377" xlink:href="blah" preserveAspectRatio="none" />
not find the absolute solution but this work around fit our needs
use preserveAspectRatio can make image almost fit the size I give and beyond part will be croped, so is I can let image's proportion similar to the size I given, it will be fine
<image preserveAspectRatio="xMidYMid slice" filter="url("#filtersPicture")" x="0" y="0" width="400" height="377" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://192.168.0.10:3000/uploads/photo/609/address/a219c3c5eb8fdce852a61385ae31bc7ee270fc73.jpg" />
Could anyone possibly explain to me why the following simple example works:
<ItemsControl x:Class="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Background="Yellow" />
<GridSplitter Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<Grid Grid.Row="2"
Background="Orange" />
</Grid>
</ItemsControl>
...but when I make the ItemsPanelTemplate's the main one, it does not:
<ItemsControl x:Class="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>
</Grid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<Grid Background="Yellow" />
<GridSplitter Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<Grid Grid.Row="2" Background="Orange" />
</ItemsControl>
They both display a Yellow box on top of an Orange box, with a horizontal splitter between them. In the first example the splitter works correctly, allowing you to resize the two areas. In the second example (that produces a near identical visual tree), the splitter is locked, it won't allow me to drag it to resize the two areas!
This is a very simplified example of what I'm trying to achieve - but it demonstrates the issue I'm getting in my actual app. I must be missing something, what's stopping the splitter from functioning? All three children get added to the ItemsPanelTemplate grid ok....
Any explanation or fix would be much appreciated!
Regards,
Dave
oh no one replied? it is because the GridSplitter must be the immediate child of the parent Grid to know the actual size of the columns.