/// <summary> /// Next Layout /// </summary> private void NextLayout() { Console.WriteLine("New Layout"); try { callback = null; PlayerSettings.firstLoadCheck = 1; FinishedRegionList.Clear(); //PlayerSettings.RegionList.Clear(); //PlayerSettings.MediaNodeList.Clear(); //PlayerSettings.AudioNodeList.Clear(); this.LayoutRoot.Children.Clear(); _layoutDuration = 0; if (_finishLayout != null) { _finishLayout(); } } catch (Exception ex) { PlayerSettings.ErrorLog(ex); } }
/// <summary> /// Set Panle using Region Details /// </summary> /// <param name="index"></param> private void SetRegionPanel(int index) { try { callback = new FinishRegionCallback(CompleteRegion); string _regionID = _layout.RegionList[index].regionId; int _widht = _layout.RegionList[index].width; int _height = _layout.RegionList[index].height; int _Top = _layout.RegionList[index].top; int _left = _layout.RegionList[index].left; PanelControl panelCon = new PanelControl(_regionID, _layout, callback) { Width = _widht, Height = _height, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top, Margin = new Thickness(_left, _Top, 0, 0) }; this.LayoutRoot.Children.Add(panelCon); } catch (Exception ex) { PlayerSettings.ErrorLog(ex); } }
public PanelControl(string index, LayoutOption layoutOption, FinishRegionCallback _callbackMethod) { InitializeComponent(); this.RegionId = index; this._callbackMethod = _callbackMethod; this._layoutOption = layoutOption; Loaded += PanelControl_Loaded; Window window = Window.GetWindow(this); Unloaded += PanelControl_Unloaded; }