public ConfigPage() { InitializeComponent(); CircleProgressBar.SetValue(ref this.pathFore, 0, true); CircleProgressBar.SetValue(ref this.pathBack, 0, false); }
private async void DownloadButton_Click(Object sender, RoutedEventArgs e) { this.DownloadButton.IsEnabled = false; Double counter = 0; //(7.2 / 3.6); Int32 count = 0; CircleProgressBar.SetValue(ref this.pathFore, counter, true); CircleProgressBar.SetValue(ref this.pathBack, counter, false); #if false const String session = ""; // 戦績リザルト 50試合 String resultJson = Ikaring2API.GetJson(Ikaring2API.RESULT_URL, session); TextFile.Write(@"iksmResult.json", resultJson, TextFile.OVER_WRITE); var resultmodel = JsonSerializser.ConvertToClass <ResultModel>(resultJson); #else var resultmodel = JsonSerializser.Load <ResultModel>(@"iksmResult.json"); #endif String filename; // 戦績詳細 バトルNo必要 foreach (var item in resultmodel.results) { counter += (7.2 / 3.6); count++; filename = $@".\Battle\BattleResult_{item.battle_number}.json"; #if false if (!System.IO.File.Exists(filename)) { String data = Ikaring2API.GetJson(String.Format(Ikaring2API.BATTLE_URL, item.battle_number), session); TextFile.Write(filename, data, TextFile.OVER_WRITE); await System.Threading.Tasks.Task.Delay(2000); } #else await System.Threading.Tasks.Task.Delay(2000); #endif CircleProgressBar.SetValue(ref this.pathFore, counter, true); CircleProgressBar.SetValue(ref this.pathBack, counter, false); this.valueBlock.Text = count.ToString(); } this.DownloadButton.IsEnabled = true; }
private static void CurrentOutputValueChanged( DependencyObject d, DependencyPropertyChangedEventArgs e) { var DstView = d as Ev3MotorDeviceView; double NewValue = (double)e.NewValue; double NewValueAbs = Math.Abs(NewValue); CircleProgressBar.SetValue(ref DstView.ForegroundBar_TargetOutput, NewValueAbs, true); CircleProgressBar.SetValue(ref DstView.BackgroundBar_TargetOutput, NewValueAbs, false); if (NewValue > 0) { DstView.ForegroundBar_TargetOutput.Stroke = new SolidColorBrush(Colors.DodgerBlue); } else { DstView.ForegroundBar_TargetOutput.Stroke = new SolidColorBrush(Colors.Fuchsia); } }