Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are right, you will need historical Data. In my opinion, whenever the bound Dependency Property <code>Rate</code> changes, you should move the old value into an IEnumerable that's defined on the graph control itself (The same place that has the DP) and use that to draw the lines. I personally would create a class named MyControlData and add an instance of that to the control.</p> <p>You might also want to add a <code>Timer</code> and move the current Rate to the IEnumerable when it Elapses, so longer streaks of the same rate will appear as multiple bars. Depends on how you actually determine progress. You might get into the following dilemma here : The <code>Rate</code> changes at a different interval than the <code>Percentage</code> in most cases - what floats your boat?</p> <p>Keeping the history in your control's scope leaves your application agnostic to the history of your Rate, but lets your control display it as required. </p> <p>To use DataBinding in a UserControl, edit the <code>&lt;UserControl x:Name="myControl"&gt;</code> node in Control.xaml and add a name like shown here. Wherever you want to bind, refer to <code>ElementName=myControl</code>. Please note that you will have to implement INotifyPropertyChanged on the Control (or on MyControlData) if you want to achieve this - or, and that would be advisable, directly implement it as a dependency property.</p> <p>And BTW, if you have no idea how to achieve what you intend to have a look into <code>ItemsControl</code>. I think what you want to do can easily be achieved by means as simple as using <code>ItemsControl</code> and <code>ItemsTemplate</code>, where the ItemsSource is your historical data and the ItemTemplate depicts your current rate in comparison to your MaxRate. MaxRate is another property you can set from the DependencyProperty <code>Rate</code>'s changed handler.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload