How to add an image at right hand side of textblock when numeric change
GridView is bind with this class, when number > 0 use up arrow image at right hand side of textblock
public class Stock: INotifyPropertyChanged { private string stockID; private double lastPrice; private double vGMoment; public Stock() { } public string StockID { get { return stockID; } set { if (StockID != value) { stockID = value; OnPropertyChanged("StockID"); } } } public double LastPrice { get { return lastPrice; } set { if (LastPrice != value) { lastPrice = value; OnPropertyChanged("LastPrice"); } } } public double VGMoment { get { return vGMoment; } set { if (VGMoment != value) { vGMoment = value; OnPropertyChanged("VGMoment"); } } } public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(String info) { PropertyChangedEventHandler handler = PropertyChanged; if (handler != null) { handler(this, new PropertyChangedEventArgs(info)); } } }
Image imgMessage = new Image(); imgMessage.Visibility = System.Windows.Visibility.Collapsed; BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri(@"C:\Users\Documents\Visual Studio 2010\Projects\testrealtimdatagrid\testrealtimdatagrid\bin\Debug\green-up-arrow.gif", UriKind.RelativeOrAbsolute); bi.EndInit(); imgMessage.Source = bi; InlineUIContainer iuc = new InlineUIContainer(imgMessage); this.Inlines.Add(iuc); this.Inlines.Add(run);
No need to worry as many books are not the core and true story