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

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.

Related

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 change color of Indeterminate ProgressBar in 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>

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.

How to design a Conversation view in windows 8 Metro App?

I'm Trying to design the Conversation View for a chat Application in windows 8 Metro App. I'm new to xaml designs, how to set the Conversation view like the image below,
Although at first time it seems this layout can be fit into Grid with three columns, I'm sure you would need scrolling at some point. So, you can just use Canvas, which allows free-floating controls. Place them with Canvas.Left and Canvas.Top attached properties.
Update: an illustration of what I mean:
<Canvas Width="300" Height="200">
<Border Width="40" Height="40" Canvas.Left="10" Canvas.Top="60" Background="Red"/>
<Border Width="160" Height="80" Canvas.Left="60" Canvas.Top="60" Background="LightGray"/>
<Border Width="40" Height="40" Canvas.Left="250" Canvas.Top="150" Background="Red"/>
<Border Width="160" Height="30" Canvas.Left="80" Canvas.Top="150" Background="LightGray"/>
</Canvas>
Let's pretend that red borders are user pics (put Image inside) and gray borders are messages (put RichTextBlock inside.) Canvas allows you to shift those blocks freely.

Windows8 ListView LineHeight

I have added a ListView to a Metro Style Blank App. Added to the ListView are 3 Strings. I want to change the LineHeight , but cannot find a property. Below is my xaml code.
<Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
<ListView HorizontalAlignment="Left" Height="277.167" Margin="235.51,161,0,0" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
<ListView.RenderTransform>
<CompositeTransform SkewX="-0.338" TranslateX="-0.327"/>
</ListView.RenderTransform>
<x:String>test 1</x:String>
<x:String>Test2</x:String>
<x:String>Test3</x:String>
</ListView>
</Grid>
How do I decrease, increase the line height of the strings in the ListView box? I want to decrease the space between the lines.
Thanks
Try editing a ItemContainerTemplate and then play with the properties available like margin and padding.
See my answer here :
WPF ComboBox customization in windows8
let me know in case you need any help.