本文整理汇总了C#中System.Windows.Controls.TextBox.SetResourceReference方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.SetResourceReference方法的具体用法?C# TextBox.SetResourceReference怎么用?C# TextBox.SetResourceReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.TextBox
的用法示例。
在下文中一共展示了TextBox.SetResourceReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnEditCargo_Click
private void btnEditCargo_Click(object sender, RoutedEventArgs e)
{
double rate = 1;
if (GameObject.GetInstance().CurrencyCountry != null)
{
CountryCurrency currency = GameObject.GetInstance().CurrencyCountry.getCurrency(GameObject.GetInstance().GameTime);
rate = currency == null ? 1 : currency.Rate;
}
TextBox tbCargoPrice = new TextBox();
tbCargoPrice.Text = string.Format("{0:0.00}", this.CargoPrice * rate);
tbCargoPrice.TextAlignment = TextAlignment.Left;
tbCargoPrice.Width = 100;
tbCargoPrice.Background = Brushes.Transparent;
tbCargoPrice.SetResourceReference(TextBox.ForegroundProperty, "TextColor");
tbCargoPrice.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
if (PopUpSingleElement.ShowPopUp(Translator.GetInstance().GetString("PanelNewRoute", "1008"), tbCargoPrice) == PopUpSingleElement.ButtonSelected.OK && tbCargoPrice.Text.Length > 0)
{
this.CargoPrice = Convert.ToDouble(tbCargoPrice.Text) / rate;
txtCargo.Text = new ValueCurrencyConverter().Convert(this.CargoPrice).ToString();
}
}