2016-07-04 16:45:45 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
using System.Windows.Documents;
|
2017-03-17 16:23:29 +01:00
|
|
|
|
using System.Windows.Forms;
|
2016-07-04 16:45:45 +02:00
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
using System.Windows.Media.Imaging;
|
|
|
|
|
|
using System.Windows.Navigation;
|
|
|
|
|
|
using System.Windows.Shapes;
|
|
|
|
|
|
using CatalogLib;
|
2017-03-17 16:23:29 +01:00
|
|
|
|
using GalaSoft.MvvmLight.Messaging;
|
|
|
|
|
|
using MaddoLibrary.Helpers;
|
2017-03-22 11:12:10 +01:00
|
|
|
|
using MahApps.Metro.Controls;
|
2017-03-17 16:23:29 +01:00
|
|
|
|
using WPFCatalog.Messages;
|
2016-07-04 16:45:45 +02:00
|
|
|
|
|
|
|
|
|
|
namespace WPFCatalog
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Interaction logic for MainWindow.xaml
|
|
|
|
|
|
/// </summary>
|
2017-03-22 11:12:10 +01:00
|
|
|
|
public partial class MainWindow
|
2016-07-04 16:45:45 +02:00
|
|
|
|
{
|
|
|
|
|
|
public PicSettings GlobalSettings = new PicSettings();
|
|
|
|
|
|
public MainWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
2017-03-22 11:12:10 +01:00
|
|
|
|
|
|
|
|
|
|
this.DataContext = new MainWindowViewModel();
|
2016-07-04 16:45:45 +02:00
|
|
|
|
|
|
|
|
|
|
SetDefaults();
|
2017-03-17 16:23:29 +01:00
|
|
|
|
|
|
|
|
|
|
//((MainWindowViewModel) DataContext).
|
|
|
|
|
|
Messenger.Default.Register<OpenFontWindowMessage>(this, OpenFonts);
|
2016-07-04 16:45:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SetDefaults()
|
|
|
|
|
|
{
|
2017-03-17 16:23:29 +01:00
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void OpenFonts(OpenFontWindowMessage message)
|
|
|
|
|
|
{
|
|
|
|
|
|
FontDialog fd = new FontDialog();
|
|
|
|
|
|
System.Windows.Forms.DialogResult dr = fd.ShowDialog();
|
|
|
|
|
|
if (dr != System.Windows.Forms.DialogResult.Cancel)
|
|
|
|
|
|
{
|
|
|
|
|
|
//DialogHelper.PopUpMessage(fd.Font.Name);
|
|
|
|
|
|
//cmbFont.Text = fd.Font.Name;
|
|
|
|
|
|
//tbSomeText.FontFamily = new System.Windows.Media.FontFamily(fd.Font.Name);
|
|
|
|
|
|
//tbSomeText.FontSize = fd.Font.Size * 96.0 / 72.0;
|
|
|
|
|
|
//tbSomeText.FontWeight = fd.Font.Bold ? FontWeights.Bold : FontWeights.Regular;
|
|
|
|
|
|
//tbSomeText.FontStyle = fd.Font.Italic ? FontStyles.Italic : FontStyles.Normal;
|
|
|
|
|
|
|
|
|
|
|
|
message.Callback(new FontData()
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = fd.Font.Name,
|
|
|
|
|
|
Size = Math.Round(fd.Font.Size) /* 96.0 / 72.0*/,
|
|
|
|
|
|
Bold = fd.Font.Bold,
|
|
|
|
|
|
Italic = fd.Font.Italic
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2016-07-04 16:45:45 +02:00
|
|
|
|
}
|
2017-03-17 16:23:29 +01:00
|
|
|
|
|
2016-07-04 16:45:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|