How to change color of Indeterminate ProgressBar in Windows phone - windows-phone

How can I change color of Indeterminate ProgressBar in Windows phone?
I have tried setting the background and border brush to null and change the foreground to black:
<ProgressBar Minimum="0" Maximum="100" IsIndeterminate="True" Foreground="Black" Background="{x:Null}" BorderBrush="{x:Null}"/>
But when I run it, it still has blue as the animation dots moving across the screen.

You need to change the <Style>
Document Outline > Right Click Progress Bar > Edit Template -> Edit A Copy
Look for
<Rectangle x:Name="E1" Fill="{ThemeResource ProgressBarIndeterminateForegroundThemeBrush}"/>
Change the Fill to any color you like
Repeat for Rectangle E2,E3,E4,E5
Or if you can just override ProgressBarIndeterminateForegroundThemeBrush
In App.xaml, like so
<Application.Resources>
<SolidColorBrush x:Key="ProgressBarIndeterminateForegroundThemeBrush" Color="Yellow" />
</Application.Resources>

Related

How to resize NavigationView and SplitView in UWP

I want to enable user to resize the NavigationView in my UWP app. Couldn't find any resources how I could do that.
I see some of the apps have "Resizable splitView" but for SplitView also, I cannot see any such resize property exposed to set by default.
Pls help.
Thanks in Advance
There are no such property can resize SplitView and NavigationView, you need to custom layout to implement a similar effect. You could use Slider control and bind the OpenPaneLength Property of SplitView to Slider.Value to do this. Please refer to the following code.
<Grid>
<SplitView Name="CoreSplitView"
DisplayMode="Inline"
IsPaneOpen="True"
OpenPaneLength="{Binding Value, ElementName=MasterSlider, Mode=OneWay}">
<SplitView.Pane>
<Grid Name="PaneGrid" Background="Gray">
<Slider Name="MasterSlider"
MinWidth="480"
VerticalAlignment="Stretch"
Maximum="480"
Minimum="10"
Opacity="0"
Value="150"
/>
<StackPanel Name="PaneStackPanel"
Margin="0,0,10,0" Background="LightGray">
<TextBlock TextWrapping="Wrap" Text="Use a slider when you want your users to be able to set defined, contiguous values (such as volume or brightness) or a range of discrete values (such as screen resolution settings).A slider is a good choice when you know that users think of the value as a relative quantity" />
</StackPanel>
</Grid>
</SplitView.Pane>
<Grid Name="ContentGrid" Background="LightSteelBlue">
</Grid>
</SplitView>
</Grid>
The StackPanel that is directly under our slider, acts like a cover for our Slider. Notice the StackPanel has Margin="0,0,10,0", this translates to a 10px distance from the right wall, which allows the Slider area to be exposed as a gray strip that is used to drag the Pane, again the 10px is arbitrary but it has to match the Minimum of the Slider.

OxyPlot in Xamarin Forms WPF project, how to change tracker text color

I'm using OxyPlot in a Xamarin Forms project.
In WPF, the tracker (popup when I click on a datapoint) has a white background with yellow text, making it impossible to see.
In UWP however, it is just fine with a yellow background and black text.
How can I change the font color of the tracker to black?
xmlns:oxy="clr-namespace:OxyPlot.Xamarin.Forms;assembly=OxyPlot.Xamarin.Forms"
<oxy:PlotView Model="{Binding MyModel}"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
</oxy:PlotView>
You can change the default colors of Oxyplot Tracker by modifying the Control Template. For example,
<oxy:PlotView Height="500" Width="500" Model="{Binding MyModel}">
<oxy:PlotView.DefaultTrackerTemplate>
<ControlTemplate>
<oxy:TrackerControl Position="{Binding Position}" LineExtents="{Binding PlotModel.PlotArea}">
<oxy:TrackerControl.Background>
<SolidColorBrush Color="LightBlue" />
</oxy:TrackerControl.Background>
<oxy:TrackerControl.Content>
<TextBlock Text="{Binding}" Margin="7" Foreground="Black" />
</oxy:TrackerControl.Content>
</oxy:TrackerControl>
</ControlTemplate>
</oxy:PlotView.DefaultTrackerTemplate>
</oxy:PlotView>
Of course, you can set the binding as well in the above, but for the sake of example, given the color directly in above example.

Can't set InkToolbarRulerButton background as transparent using InkToolbar

I create a ink toolbar, and the initial controls are all except pens.
I can set the eraser button's background as transparent, but apply to the ruler button.
Is this a ink toolbar bug?
<InkToolbar Background="Transparent" InitialControls="AllExceptPens" TargetInkCanvas="{x:Bind inkCanvas}">
<InkToolbarEraserButton Background="Transparent"/>
<InkToolbarRulerButton Background="Transparent"/>
</InkToolbar>
The rule button is actually the InkToolbarStencilButton in the visual tree, not InkToolbarRulerButton. So that update your code snippet as follows will work.
<InkToolbar
Background="Transparent"
InitialControls="AllExceptPens"
<InkToolbarEraserButton Background="Red" />
<!--<InkToolbarRulerButton Background="Red" Foreground="Blue" />-->
<InkToolbarStencilButton Background="Red"></InkToolbarStencilButton>
</InkToolbar>

How to have transparent background for button?

I am develop na UWP app, and I would like to have a transparent button. I try this (Is a simple example of my button):
<Button Name="Button"
Opacity="0">
<Image Source="/Assets/image.png"/>
</Button>
I want a button with an image, in which only the button is transparent. I've tried it that way, and by putting: Opacity="0" it puts everything transparent, and I want it to just be transparent.
Method 1
Set Opacity="0" for Button.Background. You can do it by using below code.
<Button>
<Button.Background>
<SolidColorBrush Opacity="0"/>
</Button.Background>
</Button>
Method 2
Set #00000000 as the background color of the Button. Since UWP support ARGB(Alpha RGB) color you can directly set opacity for any color in UWP app.
<Button Background="#00000000"/>

How to change the color of progress indicator in windows phone 7

I want to change the color of the progress indicator. The default color is Red. If i want to change the color to Blue mean what i have to do. I can not find any property for the indicator color. Is it possible to change the color?
<Grid Background="#7F000000" x:Name="ProgressGrid" Visibility="{Binding Path=IsVisible}">
<TextBlock HorizontalAlignment="Center" Margin="10,500,0,0" Height="100" Text="{Binding Path=AppResources.Label558, Source={StaticResource LocalizedStrings}}" FontSize="28" FontWeight="Bold" />
<ProgressBar IsIndeterminate="True" Width="383" Margin="0,500,0,0" />
</Grid>
Please let me know any idea..
Yes, it is possible. Change Foreground property of progress bar to achieve that :
<ProgressBar Foreground="Blue" />
Another thing that you missed is, progress bar color is set to phone accent theme by default. You see it Red because phone theme is set to red accent at that moment. And it isn't recommended to change the default behavior, unless you have a good reason to do so.