I've working on a project where in a page I'm having a ListBox and every ListBoxItem is an ExpanderView control... everything is working ok, but I'm having problems setting the ExpanderView header to have the maximum width (100% of the available space). I've set
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
on my ListBoxItem, but without any success...
The ExpanderView header template is using a grid view which has 1 row and 2 columns (first should have * width, second should have 100)... so far the first column expands based on the content width and doesn't stretch if needed.
Any idea how I could implement this?
Thank you in advance!
Andrei
Related
I was able to create a transparent modal popup in Xamarin forms(Version 2.2.*) by setting the background color of a stack layout to Color.FromRgba(0,0,0,0.5).
But the same is not working when i updated my Xamarin Forms to Version 2.4.*. Do we have any alternate solution to achieve this without using any third party plugins?
I'm talking about using Xamarin.PushModalAsync(View) so that i could see through the View.
You can make a color transparent by setting its alpha channel to a value between 0 and 1.
Here is one I have in my resource dictionary
<Color x:Key="BlockingColor">
<x:Arguments>
<x:Double>0</x:Double>
<x:Double>0</x:Double>
<x:Double>0</x:Double>
<x:Double>0.75</x:Double>
</x:Arguments>
</Color>
The fourth parameter is the alpha channel. Setting it to 0.75 makes it semi-transparent.
You can then use it in a style
<Style x:Key="BlockingPanel" TargetType="StackLayout">
<Setter Property="BackgroundColor" Value="{StaticResource BlockingColor}" />
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
<Setter Property="VerticalOptions" Value="FillAndExpand" />
</Style>
And then use it in XAML
<StackLayout Style={StaticResource BlockingPanel}>
</Stacklayout>
I'm new to windows phone dev. My team used syncfusion for the dropdown treenavigator. I've tried tweaking the colors, margins and padding but wasn't able to change the FontSize. Any tips?
<sfnavigation: sfTreeNavigator>
<sfnavigation:sfTreeNavigatorItem FontSize="5"/>
</sfnavigation:sfTreeNavigator>
Sorry, my laptop crashed and I couldn't remember the setter syntax but yeah tried in that too. It won't update.
Can you check the sample which i have attached? I'm able to change the FontSize for SfTreeNavigatorItem.
Sample
Code which i have used are
<Style TargetType="navigation:SfTreeNavigatorItem">
<Setter Property="FontSize" Value="10"/>
</Style>
Regards,
Jegan Raj M
I have some usercontrols that I want to put in a list:
<ListBox HorizontalContentAlignment="Stretch">
<StackPanel x:Name="audioList" />
</ListBox>
but by some reason they I'm not allowed to put the width to 100%. It does not look good, I want 100% width but not by setting it specifically to some pixel as that would break other device screen resolutions (?)
Each item within your list box is hosted within a container. You need to stretch the container as follows:
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
</Style>
</ListBox.ItemContainerStyle>
Hello,
I have used chart control in my application. I have bound Date as IndependentValueBinding (X Axis). All code is working fine but date is display horizontal So if I have many value I dont find the perfect value related to date as there are many date in X axis. So How can I display Date as Vertical on X axis.
<chart:BarSeries
IndependentValueBinding="{Binding Date}"
DependentValueBinding="{Binding Price}"/>
<chart:Chart.LegendStyle>
<Style TargetType="datavisual:Legend">
<Setter Property="Width" Value="0"/>
<Setter Property="Height" Value="0"/>
</Style>
</chart:Chart.LegendStyle>
</chart:Chart>
Thanks,
Hitesh
You will need to set the style for AxisLabelStyle, I think WP version of charts should be the same as Silverlight:
How to: Easily rotate the axis labels of a Silverlight/WPF Toolkit chart
Hi in my application i displaying the news details. It contains template(hedaline, said by and story). I need to set the foreground of the each textblock as "White" irrespective of the theme color change. Is there any common plalce set the foreground color so it will affect whole page.
Please help me , dont tell me to set the foreground to all textblocks.
Define a Style (without a x:Key) for a TextBlock and it'll automatically affect all TextBlock in your application.
If you want it only affects the whole page, add a Foreground color to the page like this,
<phone:PhoneApplicationPage Foreground="{StaticResource PhoneAccentBrush}" ...
Please note that if you apply any style to your TextBlocks on this page, this color (in this case PhoneAccentBrush) will be overwritten by the color defined in the TextBlock's style.
you can refer to this link http://innovativesingapore.com/2010/08/experession_phone/ for creating style as follows
<phone:PhoneApplicationPage.Resources>
<Style x:Key="MyStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
</Style>
</phone:PhoneApplicationPage.Resources>
And apply to the Text blocks as
<TextBlock Height="49" Name="textblock" Margin="67,49,0,0" Text="WhiteForegroundText" Style="{StaticResource MyStyle}" />