Ejemplo n.º 1
0
 private void textBoxGotFocus(object sender, RoutedEventArgs e)
 {
     if (name == "Name")
     {
         name = "";
         NewPlaylistName.GetBindingExpression(TextBox.TextProperty).UpdateTarget();
     }
 }
Ejemplo n.º 2
0
 private void EnterDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         NewPlaylistName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
         onCreateClick(sender, e);
     }
 }
Ejemplo n.º 3
0
        public AddPlaylistDialog()
        {
            InitializeComponent();
            db = Database.getInstanece();
            Binding b = new Binding();

            name     = "Name";
            b.Source = this;
            b.Path   = new PropertyPath("name");
            b.Mode   = BindingMode.TwoWay;
            NewPlaylistName.SetBinding(TextBox.TextProperty, b);
        }
Ejemplo n.º 4
0
        public void OnCreatePlaylist(object arg)
        {
            if (string.IsNullOrEmpty(NewPlaylistName))
            {
                return;
            }

            PlaylistsService.Instance.Add(new Playlist(NewPlaylistName.Trim()));
            NotifyPropertyChanged("Playlists");

            NewPlaylistName = "";
            SavePlaylist();
        }
Ejemplo n.º 5
0
 public void CancelBttn_Click(object sender, RoutedEventArgs e)
 {
     NewPlaylistName.Clear();
     TypeToggle.IsChecked = false;
     this.Visibility      = Visibility.Collapsed;
 }