سؤال

The Infragistics zoombar default position is as shown below. enter image description here

but i need it like :enter image description here please let me know how can i customize it.

هل كانت مفيدة؟

المحلول

Have you seen this Data Chart Integration (identical Silverlight live version) sample? It kind of does what you want.

As described in the documentation the Zoombar's thumb location and size are determined by the range, so looking at your image I think you want range like { 0.9 - 1 }:

<ig:XamZoombar>
    <ig:XamZoombar.Range>
        <ig:Range Minimum="0.9" Maximum="1"></ig:Range>
    </ig:XamZoombar.Range>
</ig:XamZoombar>

Adjust the minimum value to match what you want to achieve and check out the documentation/sample for snippets to set it in code.

EDIT: In the case where you have the Zoombar in sync with a chart via range binding you would have something like this instead:

<ig:XamZoombar Name="xamZoomBar" Range="{Binding ElementName=xamChart, Path=HorizontalZoombar.Range, Mode=TwoWay}"/>

Or like seen in the sample in code behind after components have been initialized:

Binding binding = new Binding
{
    Source = this.xamChart,
    Path = new PropertyPath("HorizontalZoombar.Range"),
    Mode = BindingMode.TwoWay
};
this.xamZoomBar.SetBinding(Infragistics.Controls.XamZoombar.RangeProperty, binding);

after which you can set the range and still keep the binding(sync) active:

public MainWindow()
{
    InitializeComponent();
    // Binding in code goes here if needed
    this.xamZoomBar.Range = new Infragistics.Controls.Range { Minimum = 0.9, Maximum = 1 };
}

Again, this is all available in the sample linked above. There's also an alternative way to sync the chart and zoombar via events shown there.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top