I am working on a windows phone 8.1 app, where I am not able to change the Pivot Text Header Color.
I have use below code in my pivot section, but here I can't use multi color in text blocks.
<Pivot.HeaderTemplate>
<DataTemplate>
<Grid Height="40">
<TextBlock Text="{Binding}"
Foreground="Black"
FontSize="28"
VerticalAlignment="Bottom"/>
</Grid>
</DataTemplate>
</Pivot.HeaderTemplate>
Note : I need a solution for windows phone 8.1 and also I want to change the text color not the background color.
If you want different colours in every textbox have a look at this, you'll have to use a converter
How to highlight dates in a TextBlock MVVM Light
Related
Edit Tooltip design for Slider Control in WinRT XAML, Please click for referenceIs it possible to make the tooltip always visible?
Thanks in advance.
There's no way to change the slider's default behavior. You could consider showing the current value some other way, with a label or other visual.
For example:
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Text="{Binding ElementName=slider,Path=Value}"></TextBlock>
<Slider x:Name="slider" Maximum="100"></Slider>
</StackPanel>
I want to change the color of Header inside PivotItem, i tryed a lot but doesn't works.
<PivotItem x:Name="PivotInfo" Header="Informações" Margin="0,10,0,-0.5">
.......
<Pivot>
<Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock
Text={Binding} />
</DataTemplate>
</Pivot.HeaderTemplate>
</Pivot>
you can style this textblock
I have a page with too many richtext boxes and when scrolling if user place his finger on top of rtb form doesn't scroll, user has to place his finger on empty place.
Is there any possible way to stop that behavior?
I am working on a winrt universal application, question is specifically for windows phone project.
UPDATED:
Actually I am using component one library, and for some reason I want to use its richtextbox control just like a richtextblock. Below is xaml:
<as:C1RichTextBox x:Name="rtbBox" Grid.Row="0" Background="Transparent"
BorderBrush="Transparent" BorderThickness="0" Xaml:C1NagScreen.Nag="True" IsReadOnly="True" IsTapEnabled="False" DisableSelection="True" HideCaret="True"/>
<Grid Grid.Row="0" Height="Auto" Background="Transparent"></Grid>
<Image Margin="0,0,0,20" Width="200" Grid.Row="2" Source="{Binding InstallationInstructionPic1Bind}"/>
<as:C1RichTextBox x:Name="rtb1Detail" Grid.Row="3" Background="Transparent"
BorderBrush="Transparent" BorderThickness="0" Xaml:C1NagScreen.Nag="True"
NavigationMode="Always"
/>
These border and background properties are just to make its look more like a textblock, and to stop editing I have marked isReadonly property to true in .cs file. I have also placed transparent gridview above my first rtb to scroll and that works but there are some links in some of the rtb's and if I place grid view on top of all rtb I'll not be able to click these links. Ask anything if its not clear.
I'm trying to implement a custom popup menu for one of my app bar icon button (something like the PhoneFlipMenu tool). I'm using a vertical StackPanel for that:
<StackPanel x:Name="popupMenuListCommands" Grid.Row="1"
Orientation="Vertical" VerticalAlignment="Bottom"
Background="{StaticResource PhoneDisabledBrush}"
Visibility="Collapsed">
<TextBlock Text="menu item 1" Style="{StaticResource PopupMenuListCommand}" />
<TextBlock Text="menu item 2" Style="{StaticResource PopupMenuListCommand}" />
</StackPanel>
It is shown when the user presses the app bar button:
void appBarIconButtonList_Click(object sender, EventArgs e)
{
popupMenuListCommands.Visibility = Visibility.Visible;
ApplicationBar.IsVisible = false;
}
There are 2 problems:
1) How can I retrieve the effective color of the application bar to use it in my stack panel? ApplicationBar.BackgroundColor returns #00000000, but obviously the effective color of the app bar background is not this. For instance, it is a dark gray when the dark phone theme is on.
If we cannot retrieve this color dynamically, perhaps, we just need to hard code 2 color values for the dark and white themes. Then the question is what are their values?
2) How to use the color retrieved on the previous step to make the stack panel non-transparent? Now I see the main content under it even if I specify the background brush explicitly.
App bar uses a default phone color according to the theme. So, instead of using the app bar color why not use the default theme color? That will also do the same. http://www.jeff.wilcox.name/2012/01/phonethememanager/ this will help you.
For dark theme the color is rgb (31, 31, 31).
For light theme the color is rgb (221,221,221).
Hope this helped.
Cheers
You can get the application bar color from the app resource named "PhoneChromeBrush".
So all you need to do is set the stack panel background to this brush.
<StackPanel x:Name="popupMenuListCommands" Grid.Row="1"
Orientation="Vertical" VerticalAlignment="Bottom"
Background="{StaticResource PhoneChromeBrush}"
Visibility="Collapsed">
<TextBlock Text="menu item 1" Style="{StaticResource PopupMenuListCommand}" />
<TextBlock Text="menu item 2" Style="{StaticResource PopupMenuListCommand}" />
This way you don't have to worry about the phone dark or light theme.
I am new to windows phone 8 development so any one can you please help me in getting the Original size images which is stored into the camera roll (sdcard) in windows phone. and how to swap images like only one image display in one page,next image in next page just like windows phone gallery.I want to develop app that capture images fro camera roll,but all images display same size here i use listbox & scrollviewer(can you provide simple code for this)
You should use Pivot Control and in its content load the image
<phone:Pivot x:Name="PivotAttachment"
ItemsSource="{Binding ObsDownloadedAttachments}" Foreground="Black" FontSize="48">
<phone:Pivot.ItemTemplate>
<DataTemplate>
<Image Grid.Row="1" Source="{Binding DownloadedBitmap}" />
</DataTemplate>
</phone:Pivot.ItemTemplate>
<phone:Pivot.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding ImageUrl}"
Foreground="{Binding Converter={StaticResource ThemeColorBrushConverter}}" />
</DataTemplate>
</phone:Pivot.HeaderTemplate>
<!--Pivot item one-->
<!--Pivot item two-->
</phone:Pivot>