private void OnOpenStream(object sender, RoutedEventArgs e) { StreamURLSelector streamSelector = new StreamURLSelector(); if (streamSelector.ShowDialog().GetValueOrDefault()) { openmenu.IsEnabled = false; Stop(); var stream = CodecFactory.Instance.GetCodec(new Uri(streamSelector.Value)); OpenSource(stream); } }