aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.MachineEM.UI/MainWindow.xaml
blob: 8f066800e6531f288f583eb8f969b7e1f12143d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<mahapps:MetroWindow x:Class="Tango.MachineEM.UI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
        xmlns:fa="http://schemas.fontawesome.io/icons/"
        xmlns:local="clr-namespace:Tango.MachineEM.UI"
        xmlns:views="clr-namespace:Tango.MachineEM.UI.Views"
        mc:Ignorable="d"
        Title="Tango Embedded Emulator" Height="820" Width="1300" TitleCaps="False" BorderBrush="Gray" BorderThickness="1" WindowStartupLocation="CenterScreen" Background="#202020" Foreground="Gainsboro" DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <Grid>
        <views:MainView DataContext="{StaticResource MainViewVM}"></views:MainView>
    </Grid>
</mahapps:MetroWindow>
weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.PPC.Common.Notifications.NotificationItems
{
    /// <summary>
    /// Represents a simple text message notification item which can be inserted into the application notifications panel.
    /// </summary>
    /// <seealso cref="Tango.PPC.Common.Notifications.NotificationItem" />
    public class MessageNotificationItem : NotificationItem
    {
        /// <summary>
        /// Represents the available message notification types.
        /// </summary>
        public enum MessageNotificationItemTypes
        {
            Info,
            Success,
            Warning,
            Error,
        }

        private String _message;
        /// <summary>
        /// Gets or sets the message.
        /// </summary>
        public String Message
        {
            get { return _message; }
            set { _message = value; RaisePropertyChangedAuto(); }
        }

        private String _expandedMessage;
        /// <summary>
        /// Gets or sets the extra message when the notification panel is expanded.
        /// </summary>
        public String ExpandedMessage
        {
            get { return _expandedMessage; }
            set { _expandedMessage = value; RaisePropertyChangedAuto(); }
        }

        private MessageNotificationItemTypes _messageType;
        /// <summary>
        /// Gets or sets the type of the message.
        /// </summary>
        public MessageNotificationItemTypes MessageType
        {
            get { return _messageType; }
            set { _messageType = value; RaisePropertyChangedAuto(); }
        }

        /// <summary>
        /// Gets or sets the view type.
        /// </summary>
        public override Type ViewType
        {
            get { return typeof(MessageNotificationItemView); }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageNotificationItem"/> class.
        /// </summary>
        public MessageNotificationItem() : base()
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageNotificationItem"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="expandedMessage">The expanded message.</param>
        /// <param name="type">The type.</param>
        /// <param name="pressedAction">The pressed action.</param>
        public MessageNotificationItem(String message, String expandedMessage, MessageNotificationItemTypes type, Action pressedAction) : this()
        {
            Message = message;
            ExpandedMessage = expandedMessage;
            MessageType = type;
            Pressed += (_, __) => pressedAction?.Invoke();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageNotificationItem"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="type">The type.</param>
        /// <param name="pressedAction">The pressed action.</param>
        public MessageNotificationItem(String message, MessageNotificationItemTypes type, Action pressedAction) : this(message, null, type, pressedAction)
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageNotificationItem"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="expandedMessage">The expanded message.</param>
        /// <param name="type">The type.</param>
        public MessageNotificationItem(String message, String expandedMessage, MessageNotificationItemTypes type) : this(message, expandedMessage, type, null)
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageNotificationItem"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="type">The type.</param>
        public MessageNotificationItem(String message, MessageNotificationItemTypes type) : this(message, null, type)
        {

        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MessageNotificationItem"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        public MessageNotificationItem(String message) : this(message, MessageNotificationItemTypes.Info)
        {

        }
    }
}