public override void OnApplyTemplate() { base.OnApplyTemplate(); Player = GetTemplateChild("PART_Player") as RealtimePlayer; if (Player != null) { Player.PlayHelper = new VideoPlayHelper(); } _ptzController = GetTemplateChild("PART_PtzController") as PtzController; if (_ptzController != null) { _ptzController.PtzControl += PtzController_PtzControl; } _winPanel = GetTemplateChild("PART_TopmostPanel") as WindowPanel; if (_winPanel != null) { ContainerWindow = _winPanel.ContainerWindow; } TagContainer = GetTemplateChild("PART_TagContainer") as TagContainer; if (TagContainer != null) { TagContainer.MouseRightButtonUp += TagContainer_MouseRightButtonUp; TagContainer.TagPreviewMouseLeftButtonDown += TagContainer_TagPreviewMouseLeftButtonDown; TagContainer.TagPreviewMouseLeftButtonUp += TagContainer_TagPreviewMouseLeftButtonUp; TagContainer.TagPreviewMouseMove += TagContainer_TagPreviewMouseMove; TagContainer.TagClick += TagContainer_TagClick; TagContainer.TagLocationChanged += TagContainer_TagLocationChanged; } _gridTitle = GetTemplateChild("PART_Title") as Grid; if (_gridTitle != null) { _gridTitle.MouseLeftButtonDown += GridTitle_MouseLeftButtonDown; } _btnClose = GetTemplateChild("PART_Close") as Button; if (_btnClose != null) { _btnClose.Click += BtnClose_Click; } }
public PtzPage() { InitializeComponent(); _controller = new PtzController(this); }