file360

Log | Files | Refs

MessageBox.xaml.cs (2629B)


      1 using System;
      2 using System.Collections.Generic;
      3 using System.IO;
      4 using System.Linq;
      5 using System.Runtime.InteropServices.WindowsRuntime;
      6 using Windows.Foundation;
      7 using Windows.Foundation.Collections;
      8 using Windows.UI.Xaml;
      9 using Windows.UI.Xaml.Controls;
     10 using Windows.UI.Xaml.Controls.Primitives;
     11 using Windows.UI.Xaml.Data;
     12 using Windows.UI.Xaml.Input;
     13 using Windows.UI.Xaml.Media;
     14 using Windows.UI.Xaml.Navigation;
     15 
     16 // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556
     17 
     18 namespace File360
     19 {
     20     public sealed partial class MessageBox : UserControl
     21     {
     22         public MessageBox()
     23         {
     24             InitializeComponent();
     25             heading.FontSize = Window.Current.Bounds.Width / 20;
     26             dialogDetails.FontSize = Window.Current.Bounds.Width / 30;
     27             leftButton.FontSize = Window.Current.Bounds.Width / 35;
     28         }
     29         public string HeadingText
     30         {
     31             get { return heading.Text; }
     32             set { heading.Text = value; }
     33         }
     34         public string ContentText
     35         {
     36             get { return dialogDetails.Text; }
     37             set { dialogDetails.Text = value; }
     38         }
     39         public string LeftButtonContent
     40         {
     41             get { return leftButton.Content.ToString(); }
     42             set { leftButton.Content = value; }
     43         }
     44         public string RightButtonContent
     45         {
     46             get { return rightButton.Content.ToString(); }
     47             set { rightButton.Content = value; }
     48         }
     49         public RoutedEventHandler LeftButtonHandler
     50         {
     51             get { return leftButton_Click; }
     52             set { leftButton.Click += value; }
     53         }
     54 
     55         public RoutedEventHandler RightButtonHandler
     56         {
     57             get { return rightButton_Click; }
     58             set { rightButton.Click += value; }
     59         }
     60 
     61 
     62         private void leftButton_Click(object sender, RoutedEventArgs e)
     63         {
     64             IsOpen = false;
     65         }
     66         private void rightButton_Click(object sender, RoutedEventArgs e)
     67         {
     68 
     69         }
     70 
     71         public bool IsOpen
     72         {
     73             get
     74             {
     75                 if (Height == 0)
     76                 {
     77                     return false;
     78                 }
     79                 else
     80                 {
     81                     return true;
     82                 }
     83             }
     84             set
     85             {
     86                 if (value == true)
     87                 {
     88                     Height = Window.Current.Bounds.Height;
     89                 }
     90                 if (value == false)
     91                 {
     92                     Height = 0;
     93                 }
     94             }
     95         }
     96     }
     97 }