|
34 | 34 | The following example shows how to add an item to a collection by using methods that are defined by <xref:System.ComponentModel.IEditableCollectionView>. This application displays a list of items for sale and gives the user the option of adding, editing, or removing an item. When the user adds or edits an item, a form prompts the user to enter a new item. If the user submits the form, the item is committed to the collection. If the user cancels the form, the item is discarded. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
35 | 35 |
|
36 | 36 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
|
37 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetadditem"::: |
| 37 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: |
38 | 38 |
|
39 | 39 | ]]></format>
|
40 | 40 | </remarks>
|
|
78 | 78 | The following example creates a <xref:System.Windows.Window> that prompts the user to add a new item. Then it calls <xref:System.ComponentModel.IEditableCollectionView.AddNew%2A> to create a new object and sets the <xref:System.Windows.FrameworkElement.DataContext%2A> of the <xref:System.Windows.Window> to that object. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
79 | 79 |
|
80 | 80 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
|
81 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetadditem"::: |
| 81 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: |
82 | 82 |
|
83 | 83 | ]]></format>
|
84 | 84 | </remarks>
|
|
126 | 126 | The following example checks whether an item can be added to the collection. If <xref:System.ComponentModel.IEditableCollectionView.CanAddNew%2A> is `false`, the example tells the user that an item cannot be added. Otherwise, it shows a form that prompts the user to add a new item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections) .
|
127 | 127 |
|
128 | 128 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
|
129 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetadditem"::: |
| 129 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: |
130 | 130 |
|
131 | 131 | ]]></format>
|
132 | 132 | </remarks>
|
|
170 | 170 | The following example gets <xref:System.ComponentModel.IEditableCollectionView.CanCancelEdit%2A> to check whether the original values of the edited item can be restored before it calls <xref:System.ComponentModel.IEditableCollectionView.CancelEdit%2A>. If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls <xref:System.ComponentModel.IEditableCollectionView.CancelEdit%2A>. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
171 | 171 |
|
172 | 172 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetcanceledit":::
|
173 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetcanceledit"::: |
| 173 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetcanceledit"::: |
174 | 174 |
|
175 | 175 | ]]></format>
|
176 | 176 | </remarks>
|
|
213 | 213 | The following example gets <xref:System.ComponentModel.IEditableCollectionView.CanCancelEdit%2A> to check whether the original values of the edited item can be restored before it calls <xref:System.ComponentModel.IEditableCollectionView.CancelEdit%2A>. If the values cannot be restored, you must supply additional logic to do so. If they can be, the values are restored when the example calls <xref:System.ComponentModel.IEditableCollectionView.CancelEdit%2A>. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
214 | 214 |
|
215 | 215 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetcanceledit":::
|
216 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetcanceledit"::: |
| 216 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetcanceledit"::: |
217 | 217 |
|
218 | 218 | ]]></format>
|
219 | 219 | </remarks>
|
|
251 | 251 | The following example displays a form that prompts the user to add a new item. If the user submits the form, the example calls <xref:System.ComponentModel.IEditableCollectionView.CommitNew%2A> to add the item to the collection. If the user cancels the form, the example calls <xref:System.ComponentModel.IEditableCollectionView.CancelNew%2A> to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
252 | 252 |
|
253 | 253 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
|
254 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetadditem"::: |
| 254 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: |
255 | 255 |
|
256 | 256 | ]]></format>
|
257 | 257 | </remarks>
|
|
295 | 295 | The following example calls <xref:System.ComponentModel.IEditableCollectionView.CanRemove%2A> to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls <xref:System.ComponentModel.IEditableCollectionView.Remove%2A> if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
296 | 296 |
|
297 | 297 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetremoveitem":::
|
298 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetremoveitem"::: |
| 298 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetremoveitem"::: |
299 | 299 |
|
300 | 300 | ]]></format>
|
301 | 301 | </remarks>
|
|
333 | 333 | The following example creates a form that prompts the user to edit an existing item. If the user submits the form, the example calls <xref:System.ComponentModel.IEditableCollectionView.CommitEdit%2A> to save the changes to the collection. If the user cancels the form, the example calls <xref:System.ComponentModel.IEditableCollectionView.CancelEdit%2A> to discard the changes. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
334 | 334 |
|
335 | 335 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetedititem":::
|
336 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetedititem"::: |
| 336 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetedititem"::: |
337 | 337 |
|
338 | 338 | ]]></format>
|
339 | 339 | </remarks>
|
|
376 | 376 | The following example displays a form that prompts the user to add a new item. If the user submits the form, the example calls <xref:System.ComponentModel.IEditableCollectionView.CommitNew%2A> to add the item to the collection. If the user cancels the form, the example calls <xref:System.ComponentModel.IEditableCollectionView.CancelNew%2A> to discard the item. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
377 | 377 |
|
378 | 378 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetadditem":::
|
379 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetadditem"::: |
| 379 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetadditem"::: |
380 | 380 |
|
381 | 381 | ]]></format>
|
382 | 382 | </remarks>
|
|
473 | 473 | The following example creates a form that prompts the user to edit an existing item. If the user submits the form, the changes are committed to the collection. If the user cancels the form, the changes are discarded. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections) .
|
474 | 474 |
|
475 | 475 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetedititem":::
|
476 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetedititem"::: |
| 476 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetedititem"::: |
477 | 477 |
|
478 | 478 | ]]></format>
|
479 | 479 | </remarks>
|
|
619 | 619 | The following example calls <xref:System.ComponentModel.IEditableCollectionView.CanRemove%2A> to check whether an item can be removed from the collection. If an item can be removed, the example prompts the user to confirm the action and calls <xref:System.ComponentModel.IEditableCollectionView.Remove%2A> if the user clicks **Yes**. For the entire sample, see [Changing a Collection by Using IEditableCollectionView Sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/EditingCollections).
|
620 | 620 |
|
621 | 621 | :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/IEditableCollectionView/Overview/Window1.xaml.cs" id="Snippetremoveitem":::
|
622 |
| - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/EditingCollectionsSnippets/visualbasic/window1.xaml.vb" id="Snippetremoveitem"::: |
| 622 | + :::code language="vb" source="~/snippets/visualbasic/System.ComponentModel/IEditableCollectionView/Overview/window1.xaml.vb" id="Snippetremoveitem"::: |
623 | 623 |
|
624 | 624 | ]]></format>
|
625 | 625 | </remarks>
|
|
0 commit comments