private StackPanel GetAddBlockPanel() { var margin = new Thickness(0, 0, 0, 20); const double fontSize = 30; _addBlockPanel = new StackPanel(); var lastTimeValue = _timeSlider != null?_timeSlider.GetTimeValue() : DefaultTime; var label = new TextBlock { Text = AppResources.IntervalAddLabel, Margin = margin, TextWrapping = TextWrapping.Wrap, FontSize = fontSize }; _tbxLabel = new PhoneTextBox { Height = 72, Width = 456, HorizontalAlignment = HorizontalAlignment.Left, TextWrapping = TextWrapping.Wrap, Hint = "Block n°" + (_viewModel.Blocks.Count + 1) }; var tbkTemps = new TextBlock { Text = AppResources.IntervalAddTime, Margin = margin, TextWrapping = TextWrapping.Wrap, FontSize = fontSize }; _timeSlider = new TimeLabeledRadialSlider { TextFontSize = 90, }; _timeSlider.SetTimeValue(lastTimeValue); _addBlockPanel.Children.Add(label); _addBlockPanel.Children.Add(_tbxLabel); _addBlockPanel.Children.Add(tbkTemps); _addBlockPanel.Children.Add(_timeSlider); return(_addBlockPanel); }
private void Button_Click(object sender, System.Windows.RoutedEventArgs e) { var tbx = new PhoneTextBox() { Hint = "Titre", Margin = new Thickness(0, 14, 0, -2) }; var uc = new TimeLabeledRadialSlider(); TiltEffect.SetIsTiltEnabled(tbx, true); var messageBox = new CustomMessageBox() { Caption = "Donnez un titre à ce temps", Content = uc, LeftButtonContent = "ok", RightButtonContent = "annuler", IsFullScreen = false }; messageBox.Dismissed += (s1, e1) => { switch (e1.Result) { case CustomMessageBoxResult.LeftButton: var b = (Button)sender; b.Content = uc.GetTimeValue().ToString(); //var saved = _chronometerStore.SaveNew(tbx.Text, _stopWatch.Elapsed); //var message = saved ? "Le temps a été enregistré." : "Une erreur est survenue."; //Popup(message); // confirmation break; case CustomMessageBoxResult.RightButton: case CustomMessageBoxResult.None: default: break; } }; messageBox.Show(); //*/ }