public WpfEpisodeView() { InitializeComponent(); DescriptionWebBrowser.NavigateToString("<p>This is a description in a paragraph.</p>" + "<p>The second paragraph has <b>bold</b>, <i>italics</i> and <a href=\"http://markheath.net\">a link</a>"); var r = new Random(); var peaks = Enumerable.Range(1, 3000).Select(n => r.NextDouble()).Select(d => (float)d).ToArray(); WaveformControl.SetPeaks(peaks); }
public void Init(WaveformControl waveformControl, TextBlock textBlockDuration, Border borderPlay, Border borderPause) { this._waveformControl = waveformControl; this._textBlockDuration = textBlockDuration; this._borderPlay = borderPlay; this._borderPause = borderPause; this.UnubscribeFromManipulationEvents(); this.SubscribeToManipulationEvents(); this._waveformControl.Waveform = this._voiceMessage.Waveform; this._player.InitializePlayer(); }
protected override void GenerateChildren() { double maximum = 0.0; double num1 = 0.0; string currentDuration = ""; if (this._isInitialized) { maximum = ((RangeBase)this._waveformControl).Maximum; num1 = ((RangeBase)this._waveformControl).Value; currentDuration = this._textBlockDuration.Text; } Ellipse ellipse = new Ellipse(); double num2 = 56.0; ((FrameworkElement)ellipse).Width = num2; double num3 = 56.0; ((FrameworkElement)ellipse).Height = num3; double num4 = 2.0; ((Shape)ellipse).StrokeThickness = num4; SolidColorBrush solidColorBrush1 = (SolidColorBrush)Application.Current.Resources["PhoneAccentBlueBrush"]; ((Shape)ellipse).Stroke = ((Brush)solidColorBrush1); this.Children.Add((FrameworkElement)ellipse); Grid grid1 = new Grid(); double num5 = 56.0; ((FrameworkElement)grid1).Width = num5; double num6 = 56.0; ((FrameworkElement)grid1).Height = num6; SolidColorBrush solidColorBrush2 = new SolidColorBrush(Colors.Transparent); ((Panel)grid1).Background = ((Brush)solidColorBrush2); Grid grid2 = grid1; MetroInMotion.SetTilt((DependencyObject)grid2, 1.5); ImageBrush imageBrush1 = new ImageBrush(); ImageLoader.SetImageBrushMultiResSource(imageBrush1, "/Resources/WallPost/AttachPlay.png"); Border border1 = new Border(); double num7 = 32.0; ((FrameworkElement)border1).Width = num7; double num8 = 32.0; ((FrameworkElement)border1).Height = num8; SolidColorBrush solidColorBrush3 = (SolidColorBrush)Application.Current.Resources["PhoneAccentBlueBrush"]; border1.Background = ((Brush)solidColorBrush3); ImageBrush imageBrush2 = imageBrush1; ((UIElement)border1).OpacityMask = ((Brush)imageBrush2); this._borderPlay = border1; ((PresentationFrameworkCollection <UIElement>)((Panel)grid2).Children).Add((UIElement)this._borderPlay); ImageBrush imageBrush3 = new ImageBrush(); ImageLoader.SetImageBrushMultiResSource(imageBrush3, "/Resources/WallPost/AttachPause.png"); Border border2 = new Border(); double num9 = 32.0; ((FrameworkElement)border2).Width = num9; double num10 = 32.0; ((FrameworkElement)border2).Height = num10; int num11 = 1; ((UIElement)border2).Visibility = ((Visibility)num11); SolidColorBrush solidColorBrush4 = (SolidColorBrush)Application.Current.Resources["PhoneAccentBlueBrush"]; border2.Background = ((Brush)solidColorBrush4); ImageBrush imageBrush4 = imageBrush3; ((UIElement)border2).OpacityMask = ((Brush)imageBrush4); this._borderPause = border2; ((PresentationFrameworkCollection <UIElement>)((Panel)grid2).Children).Add((UIElement)this._borderPause); ((UIElement)grid2).Tap += (new EventHandler <System.Windows.Input.GestureEventArgs>(this.ToggleButtonPlayer_OnClick)); this.Children.Add((FrameworkElement)grid2); double num12 = this.CurrentWidth - 68.0; Border border3 = new Border(); double num13 = num12; ((FrameworkElement)border3).Width = num13; Border border4 = border3; Canvas.SetLeft((UIElement)border4, 68.0); WaveformControl waveformControl = new WaveformControl(); double num14 = num12; ((FrameworkElement)waveformControl).Width = num14; double num15 = 32.0; ((FrameworkElement)waveformControl).Height = num15; int num16 = 0; ((Control)waveformControl).IsEnabled = (num16 != 0); this._waveformControl = waveformControl; border4.Child = ((UIElement)this._waveformControl); this.Children.Add((FrameworkElement)border4); TextBlock textBlock = new TextBlock(); double num17 = 18.0; textBlock.FontSize = num17; SolidColorBrush solidColorBrush5 = (SolidColorBrush)Application.Current.Resources["PhoneBlue300_GrayBlue100Brush"]; textBlock.Foreground = ((Brush)solidColorBrush5); string str = "00:00"; textBlock.Text = str; this._textBlockDuration = textBlock; Canvas.SetLeft((UIElement)this._textBlockDuration, 68.0); Canvas.SetTop((UIElement)this._textBlockDuration, 32.0); this.Children.Add((FrameworkElement)this._textBlockDuration); this._playerWrapper.Init(this._waveformControl, this._textBlockDuration, this._borderPlay, this._borderPause); this._playerWrapper.SetValues(maximum, num1, currentDuration); this.UpdateWaveformWidth(); this._isInitialized = true; }