private void GetInstrumentList(ObservableCollection<ExchangInstrument> exchangeInstruments)
 {
     this.InstrumentList.ItemsSource = null;
     this._InstrumentItems.Clear();
     TaskMenuItemEntity menuItem = new TaskMenuItemEntity();
     menuItem.MenuTitle = "Instrument List";
     foreach (ExchangInstrument item in exchangeInstruments)
     {
         TaskMenuEventItem eventItem = new TaskMenuEventItem() { ExchangeCode = item.ExchangeCode, InstrumentCode = item.InstrumentCode, ImageUri = ImageSources.Instance.EnableTaskImage };
         menuItem.TaskMenuEventItems.Add(eventItem);
     }
     this._InstrumentItems.Add(menuItem);
     this.InstrumentList.ItemsSource = this._InstrumentItems;
 }
        private void IntilizeTaskMenu()
        {
            TaskMenuItemEntity menuItem = new TaskMenuItemEntity();
            menuItem.MenuTitle = "Task Scheduler";
            TaskMenuEventItem eventItem1 = new TaskMenuEventItem() { ActionName = "Create Tasks", ActionType = TaskEventType.CreateTask, ImageUri = ImageSources.Instance.CreateTaskImage };
            TaskMenuEventItem eventItem2 = new TaskMenuEventItem() { ActionName = "Editor Task", ActionType = TaskEventType.EditorTask, ImageUri = ImageSources.Instance.EditorTaskImage };
            TaskMenuEventItem eventItem3 = new TaskMenuEventItem() { ActionName = "Deleted Tasks", ActionType = TaskEventType.DeleteTask, ImageUri = ImageSources.Instance.DeleteTaskImage };
            TaskMenuEventItem eventItem4 = new TaskMenuEventItem() { ActionName = "Refresh Task", ActionType = TaskEventType.RefreshTask, ImageUri = ImageSources.Instance.RefreshTaskImage };
            menuItem.TaskMenuEventItems.Add(eventItem1);
            menuItem.TaskMenuEventItems.Add(eventItem2);
            menuItem.TaskMenuEventItems.Add(eventItem3);
            menuItem.TaskMenuEventItems.Add(eventItem4);

            TaskMenuItemEntity eventMenuItem = new TaskMenuItemEntity();
            eventMenuItem.MenuTitle = "Task Action";
            TaskMenuEventItem eventItem5 = new TaskMenuEventItem() { ActionName = "Run Tasks", ActionType = TaskEventType.RunTask, ImageUri = ImageSources.Instance.RunTaskImage };
            TaskMenuEventItem eventItem6 = new TaskMenuEventItem() { ActionName = "Enabled Tasks", ActionType = TaskEventType.EnableTask, ImageUri = ImageSources.Instance.EnableTaskImage };
            TaskMenuEventItem eventItem7 = new TaskMenuEventItem() { ActionName = "Disabled Task", ActionType = TaskEventType.DisabledTask, ImageUri = ImageSources.Instance.DisabledTaskImage };
            TaskMenuEventItem eventItem8 = new TaskMenuEventItem() { ActionName = "Stop Task", ActionType = TaskEventType.StopTask, ImageUri = ImageSources.Instance.StopTaskImage };
            eventMenuItem.TaskMenuEventItems.Add(eventItem5);
            eventMenuItem.TaskMenuEventItems.Add(eventItem6);
            eventMenuItem.TaskMenuEventItems.Add(eventItem7);
            eventMenuItem.TaskMenuEventItems.Add(eventItem8);

            this._TaskMenuItems.Add(menuItem);
            this._TaskMenuItems.Add(eventMenuItem);
            this.TaskMenuCanva.ItemsSource = this._TaskMenuItems;

            this.TaskMenuCanva.ItemClicked += new RoutedEventHandler(this.ItemClickHandler);
            this._IsInitilizedTaskMenu = true;
        }
 public void SetBinding(TaskMenuEventItem item)
 {
     this.DataContext = item;
 }