private void HighlightBtn_Click(object sender, RibbonControlEventArgs e)
        {
            var application   = Globals.ThisAddIn.Application;
            var selectedMails = application.ActiveExplorer().Selection.OfType <Microsoft.Office.Interop.Outlook.MailItem>();

            if (selectedMails.Any())
            {
                var viewmodel = new HighlightViewModel(selectedMails);
                var window    = new HighlightControl();
                window.DataContext = viewmodel;
                window.Show();
            }
            else
            {
                MessageBox.Show("Please select atleast one mail in the list");
            }
        }
Example #2
0
 public HighlightControl(HighlightViewModel ViewModel)
 {
     DataContext = ViewModel;
 }