WPF
0
Вклад в тег
public interface IWindowService
{
public void ShowWindow<T>(object dataContext) where T : Window, new();
}
public class WindowService : IWindowService
{
public void ShowWindow<T>(object dataContext) where T : Window, new()
{
var window = new T
{
DataContext = dataContext
};
window.Show();
}
}
// PS. ws = WindowService
public void ExecuteShowGraph(object parameter)
{
ws.ShowWindow<GraphWindow>(new GraphViewModel(Коллекция точек для графика));
}