I am trying to make an InkToolbar whose ballpens and pencils' size can't be changed. Basically, the actual appearance is this one (the button has a slider with a "size" text) and I want to remove it so it looks like this, without that slider. I've read the whole tutorial about custom ink toolbars, but I haven't been able to find the property that I want to remove. In fact, I'm not sure if I can do so. Is there any way to prevent users from seeing and using this size property?
Asked
Active
Viewed 76 times
1 Answers
1
You can custom InkToolbarPenConfigurationControl
located in Generic.xaml
in your pc.
For details.
Step 1, open Generic.xaml
, find text <Style TargetType="InkToolbarPenConfigurationControl">
, copy out the whole Style, you can also see on my gist.
Step 2, paste the style code to your App.xaml
. Note this will override all your InkToolbarPen
button.
<Application
x:Class="App2.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App2">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/FavoriteButtonStyle.xaml"/>
<ResourceDictionary Source="/BorderlessGridViewItem.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!--Paste your style code here-->
</ResourceDictionary>
</Application.Resources>
</Application>
Step 3, find the Slider
control, set Visibility
to Collapsed
. Done!!!

Vincent
- 3,124
- 3
- 21
- 40