コード例 #1
0
        //public event Action RemoveItem;

        private void Delete_Button_Click(object sender, RoutedEventArgs e)
        {
            var btn = (Button)sender;
            KeyValuePair <object, object> dvp;

            if (btn.DataContext is KeyValuePair <object, object> )
            {
                dvp = (KeyValuePair <object, object>)btn.DataContext;
            }
            else
            {
                dvp = new KeyValuePair <object, object>();
            }

            Data.Remove(dvp.Key);

            //if (RemoveItem != null)
            //{
            //    RemoveItem();
            //}

            var ef = new ExtensionInfoField(Data);

            PropGrid.DataContext    = ef;
            PropGrid.SelectedObject = ef;

            MainView.ItemsSource = null;
            MainView.ItemsSource = Data;
        }
コード例 #2
0
		//public event Action RemoveItem;

		private void Delete_Button_Click(object sender, RoutedEventArgs e)
		{
			var btn = (Button)sender;
			KeyValuePair<object, object> dvp;
			if (btn.DataContext is KeyValuePair<object, object>)
			{
				dvp = (KeyValuePair<object, object>)btn.DataContext;
			}
			else
			{
				dvp = new KeyValuePair<object, object>();
			}

			Data.Remove(dvp.Key);

			//if (RemoveItem != null)
			//{
			//    RemoveItem();
			//}

			var ef = new ExtensionInfoField(Data);
			PropGrid.DataContext = ef;
			PropGrid.SelectedObject = ef;

			MainView.ItemsSource = null;
			MainView.ItemsSource = Data;
		}