I'm creating a WP Mango app. I want to set the default page background to White, irrespective of whether Light or Dark Theme is selected, exactly like the default mail application.
I've followed this article and tried changing the default PhoneBackgroundBrush as:
(Application.Current.Resources["PhoneBackgroundBrush"]as SolidColorBrush).Color = Colors.White;
Any idea what I'm doing wrong or how to achieve that?
I messed with the sample, and simply don't recommend doing this. Do the extra work, create your own resources, and apply them yourself.
This method doesn't show updates in the designer, which will make your UI development difficult.
It also doesn't even work properly -- the background doesn't change. If you read the comments on the blog post, there are other issues with it working with other controls.
So, just do it normally - in your App.xaml (you could also do it in a seperate ResourceDictionary)
<!--Application Resources-->
<Application.Resources>
<SolidColorBrush Color="White" x:Key="WhiteBrush" />
<SolidColorBrush Color="#FFF222" x:Key="UglyYellowBrush" />
</Application.Resources>
then, on a page
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="{StaticResource UglyYellowBrush}">
... </Grid>
You could even do this quickly on all your pages using Find & Replace, provided that you never changed the name 'LayoutRoot'. If you find
<Grid x:Name="LayoutRoot" Background="Transparent">
you can replace with
<Grid x:Name="LayoutRoot" Background="{StaticResource UglyYellowBrush}">
The solution of creating your own style did not work for me. I tried setting the background to a light gray which worked in the design view but when I ran the emulator the standard black background appeared.
Related
I have an SVG of the US states, and need anchor links to scroll to the state info on the page below. The anchors work fine on desktop and android, but not on IOS. The state changes to to hover color when clicked and does not link, and the hover color remains.
I found some suggestions to use xlink:href, but that is depreciated. I did try it to see if it worked and it did not. I have also tried some suggestions providing jquery code, but it did not work and also stopped the links from working on desktop.
The SVG is set up with hrefs wrapping each path like this:
<svg viewbox="0 0 959 593"> <a href="#ak"> <path id="AK" ...">
<title>Alaska</title></path></a>
(I've removed the long string of code for the path)
Here is the link to the page with the map. The anchor links work on desktop and android and not IOS:
https://www.automatictrap.com/pages/trappable-species
I have never posted here before, so I apologize if this is not enough info.
This has been resolved. Some of the anchor links on iPhone only seem to work when "a id" is used, and the links from the SVG only work when "a name" is used.
I have an edit control on my custom dialog, that defaults to a session property SERVICE_URL.
<Control Id="serviceUrlTextBox" Type="Edit" X="135" Y="45" Height="17" Width="215" Property="SERVICE_URL" />
If the text fits the textbox, everything looks alright, if the text is too long however, the border goes missing. If the user adds/removes text (once the dialog is shown), that doesn't change the appearance, only the initial length has an effect.
Using Multiline="yes" does not help, the text is never wrapped and there is no border either.
How can I keep the border even if the text is too long? I'm using WiX Toolset v3.8.
EDIT: The background plays a role, as Buzka suggested (notice the background "crowding in" when the text is too long). Clearly a bug. Any ideas how I can get it to work short of removing the background?
That's how I have created the different background:
<Binary Id="dialogBackground" SourceFile="Resources\WixUIDialogBackground.png"/>
<Control Id="background" Type="Bitmap" Text="dialogBackground" Width="370" Height="243" X="0" Y="53" TabSkip="no" />
<Control Id="explanationLabel" X="135" Y="23" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="215" Height="100" Text="Please provide the URL of the SettingsService. If you prefer, you may change it at a later stage in the Settings." />
<Control Id="serviceUrlTextBox" Type="Edit" X="135" Y="45" Height="17" Width="215" Property="SERVICE_URL" />
I'm using v3.8 too, don't have that problem in my installer. I can see you use custom background color, maybe thats reason?
#Edit
I mean maybe you should set custom border to textbox too? Or try with default backgroud color.
#Edit
After LOOOOONG searching... i found something like this:
Unfortunately, that's how MSI draws it. There's no concept of a custom
control in MSI UI, so there's nothing WiX can do to fix it.
So i think my answer was good, no chances to change it, cause it's not supported.
Is there any way to completely remove the header in the Windows Phone 7 control toolkit ListPicker? E.g., setting the header height size = 0 or something similar?
In my app I want to remove the header in order to reduce the space taken up by the list picker. I'm going to have the default selected item in the list picker with a descriptive text instead (along with a valid value of course). I've solved that part.
Thanks in advance for any help!
Download the source from here:
http://silverlight.codeplex.com/SourceControl/changeset/changes/71382
Open up ListPickerPage.xaml (Microsoft.Phone.Controls.Toolkit -> ListPicker)
Find this section of code:
<!-- Header Title -->
<TextBlock
x:Name="HeaderTitle"
Grid.Row="0"
FontFamily="{StaticResource PhoneFontFamilySemiBold}"
FontSize="{StaticResource PhoneFontSizeMedium}"
Foreground="{StaticResource PhoneForegroundBrush}" Visibility="Collapsed"
Margin="24 12 12 12">
<TextBlock.Projection>
<PlaneProjection RotationX="-90"/>
</TextBlock.Projection>
</TextBlock>
Note that the Visibility is now set to Collapsed
Then, below it, find the ListBox code
<!-- List of Items -->
<ListBox
x:Name="Picker"
Grid.Row="1"
ItemsSource="{Binding}"
Opacity="0"
toolkit:TiltEffect.IsTiltEnabled="True"
Margin="24 -24 0 0"
Tap="OnPickerTapped"/>
</Grid>
Note that I changed the margin here to -24.
Mess with it till you find the look that you need. Make sure you have your app use the DLL that is created when you build the Silverlight Toolkit project.
There could be a better way. For example, you could create your own PickerPageUri .
But, I'm not entirely sure that modifying the UI in this way to achieve another 40px of space is really worth breaking the WP7 paradigm. But whatever, your choice.
Is it possible to change the color and other CSS properties of anchors in iBooks epubs?
The color property doesn't react at all, while I do get background-color change on normal and hover link state (which activates on tap). The :hover background-color also remains after I come back to the book from Safari, until I tap another link on the same page, then the first one loses :hover bg color and the second one gets it.
:visited, :active or :focus don't do anything.
Am I missing something?
** Update 2012.09.12 **
You can now specify the option "specified-fonts" in the special ibooks file "com.apple.ibooks.display-options.xml" located in META-INF folder :
<?xml version="1.0" encoding="UTF-8"?>
<display_options>
<platform name="*">
<option name="specified-fonts">true</option>
</platform>
</display_options>
This will activate anchors styling, but only when the reader choose the font "Original" in iBooks. So you still need to use the trick beneath for the other fonts.
** End of update 2012.09.12 **
You're not missing anything, iBooks does not support style on links.
There is a way to get around it with the property -webkit-text-fill-color.
Be aware that it doesn't do anything on Adobe Digital Editions.
Here is a sample :
a:link, a:visited, a:hover, a:active
{
-webkit-text-fill-color: red;
}
I got this from twitter on #eprdctn.
I have some problems
1. how do I make my statusbar context menu that consists of 2 choices of menu preferences and addons status
example of context menu i want to make
this is my code :
<popupset>
<menupopup id="intransContextMenu">
<menuitem label="intrans aktif"/>
<menuitem label="preferensi"/>
</menupopup>
</popupset>
<statusbar id="status-bar">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<statusbarpanel id="status-bar-intrans"
label="intrans"
context="intransContextMenu"
onclick="alert('okeh cuy')"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
how to add images in the context menu? I have tried but why do I paste a picture that always appears under the label is not on the side of the label as I expected?
example of context menu i want to make
this is my code :
<popup id="contentAreaContextMenu">
<image src="chrome://inlinetrans/skin/imagesOn_kecil.png" />
<menuitem class="inlinetrans" id="inlineContext" oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"/>
</popup>
note :
whether the code used to display the menu by right clicking on the statusbar and allows web pages to be made in one file?
thank you for the answer..
I am not sure if the images are your only problem now? Opening the context menu should work (you are using the context attribute correctly).
Regarding images, have a look at the documentation. For statusbarpanel, you have to set the image attribute:
<statusbar id="status-bar">
<statusbarpanel id="status-bar-intrans"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"
label="intrans"
context="intransContextMenu"
onclick="alert('okeh cuy')"
tooltiptext="intrans versi 1.0"
/>
</statusbar>
You might also want to have a look at the style classes and play with them (to be honest I'm not 100% sure if it is just sufficient to set the image attribute, so if this does not work, try with the style classes).
Similar for the menuitem. You have to set the image attribute and give the element the style class menu-iconic:
<menuitem class="inlinetrans menu-iconic"
id="inlineContext"
oncommand= "hadits_mean.startFind(null);"
label="Cari Terjemahan"
image="chrome://inlinetrans/skin/imagesOn_kecil.png"/>
Note: Afaik the statusbar is going to be removed in Firefox 4 (at least by default it is disabled)!