Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New requirements for Slider controls. #3752

Open
aqingGitHub opened this issue Jan 2, 2025 · 2 comments
Open

New requirements for Slider controls. #3752

aqingGitHub opened this issue Jan 2, 2025 · 2 comments
Labels
mdix.mahapps Item relates to the MaterialDesignThemes.MahApps project

Comments

@aqingGitHub
Copy link

image

I need to set a parameter range and hope to implement this feature through RangeSlider by adding two Thumbs to it.

The most basic Properties included are: StartValue, EndValue, Minimum,Maximum、TickFrequency.
The StartValue always < EndValue

Thanks!

@aqingGitHub aqingGitHub added enhancement evaluation required Items is pending review or evaluation by the team labels Jan 2, 2025
@Keboo
Copy link
Member

Keboo commented Jan 3, 2025

You might want to take a look at the integration with MahApps. They already have a range slider control and the integration library provides material theming for it.

<smtx:XamlDisplay UniqueKey="Slider_2">
<controls:RangeSlider Margin="6,16,6,0"
LowerValue="25"
TickFrequency="10"
TickPlacement="BottomRight"
UpperValue="75" />
</smtx:XamlDisplay>
<smtx:XamlDisplay UniqueKey="Slider_3">
<controls:RangeSlider Height="200"
Margin="0,16,0,0"
LowerValue="25"
Orientation="Vertical"
UpperValue="75" />
</smtx:XamlDisplay>

@Keboo Keboo added mdix.mahapps Item relates to the MaterialDesignThemes.MahApps project and removed enhancement evaluation required Items is pending review or evaluation by the team labels Jan 3, 2025
@aqingGitHub
Copy link
Author

@Keboo Thanks a lot!!!
I want to change the Thumb and the color between them(#004EA2), but I tried to change the foreground color but it didn't take effect.

Step1: NuGet install MaterialDesignThemes.MahApps

Step2: Add
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Defaults.xaml" />
to App.xaml

Step3: In xaml UI, Using
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"

Add
<controls:RangeSlider Foreground="#004EA2" Grid.Column="1" LowerValue="{Binding VoltageStartValue}" UpperValue="{Binding VoltageEndValue}" Minimum="0" Maximum="20" TickFrequency="0.1" Height="20" VerticalAlignment="Center"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mdix.mahapps Item relates to the MaterialDesignThemes.MahApps project
Projects
None yet
Development

No branches or pull requests

2 participants