Here's how I earned it:
WPF User Interface
<UserControl x:Class="App.ProcessView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> </Grid> </UserControl>
C # user control
namespace App { /// <summary> /// Interaction logic for ProcessView.xaml /// </summary> public partial class ProcessView : UserControl // My custom User Control { public ProcessView() { InitializeComponent(); } } }
MainWindow WPF
<Window x:Name="RootWindow" x:Class="App.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:app="clr-namespace:App" Title="Some Title" Height="350" Width="525" Closing="Window_Closing_1" Icon="bouncer.ico"> <Window.Resources> <app:DateConverter x:Key="dateConverter"/> </Window.Resources> <Grid> <ListView x:Name="listView" > <ListView.ItemTemplate> <DataTemplate> <app:ProcessView /> </DataTemplate> </ListView.ItemTemplate> </ListView> </Grid> </Window>
Mažvydas Tadaravičius Feb 06 '17 at 11:45 2017-02-06 11:45
source share