Coder Social home page Coder Social logo

devexpress-examples / how-to-use-custom-elements-in-the-linear-gauge-control-e3537 Goto Github PK

View Code? Open in Web Editor NEW
0.0 56.0 0.0 136 KB

Display Up and Down buttons within a linear gauge.

License: Other

C# 51.37% Visual Basic .NET 48.63%
dotnet dxgauges wpf xpf data-visualization devexpress gauge linear-gauge ui-customization gauge-indicator

how-to-use-custom-elements-in-the-linear-gauge-control-e3537's Introduction

WPF Linear Gauge - Display Custom UI Elements

This example displays Up and Down buttons within the linear scale. The Up button increases the scale value. The Down button decreases the scale value.

WPF Linear Gauge - Display Custom UI Elements, DevExpress

Implementation Details

Create a ScaleCustomElement object with a custom UI element and add the object to the Scale.CustomElements collection to display custom content within a scale. This example creates two ScaleCustomElement objects with Up and Down buttons:

<dxga:LinearScale >
    <dxga:LinearScale.CustomElements>
        <dxga:ScaleCustomElement VerticalAlignment="Top" HorizontalAlignment="Right">
            <Button Name="button1" Content="Up" Width="59"  Click="button1_Click" />
        </dxga:ScaleCustomElement>
        <dxga:ScaleCustomElement VerticalAlignment="Bottom" HorizontalAlignment="Right">
            <Button Name="button2" Content="Down" Width="59" Click="button2_Click" />
        </dxga:ScaleCustomElement>
    </dxga:LinearScale.CustomElements>
</dxga:LinearScale>

The Click event of each button is handled to allow users to change the scale value:

private void button1_Click(object sender, RoutedEventArgs e) {
    if (bar.Value < 100)
        bar.Value += 10;
}
private void button2_Click(object sender, RoutedEventArgs e) {
    if (bar.Value > 0)
        bar.Value -= 10;
}

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

how-to-use-custom-elements-in-the-linear-gauge-control-e3537's People

Contributors

albertov05 avatar alexilia avatar devexpressexamplebot avatar iam0k avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.