示例#1
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            HardwareButtons.BackPressed += HardwareButtons_BackPressed;

            dataTransfer = DataTransferManager.GetForCurrentView();
            dataTransfer.DataRequested += dataTransfer_DataRequested;

            statusBar.BackgroundColor = Util.ConvertStringToColor("#FFD25349");
            statusBar.ForegroundColor = Util.ConvertStringToColor("#FFE9E7E3");

            statusBar.BackgroundOpacity = 1;

            if (e.Parameter != null)
            {
                post = (Post)e.Parameter;
            }

            if (NetworkInterface.GetIsNetworkAvailable())
            {
                if (e.Parameter != null)
                {
                    this.FillPost();
                }
            }
            else
            {
                BtnShare.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                content_post.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                internet.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }

            try
            {
                networkStatusCallback = new NetworkStatusChangedEventHandler(OnNetworkStatusChange);
                if (!registeredNetworkStatusNotif)
                {
                    NetworkInformation.NetworkStatusChanged += networkStatusCallback;
                    registeredNetworkStatusNotif = true;
                }
            }
            catch (Exception ex)
            {

            } 
        }
示例#2
0
        private void BtnShare_Click(object sender, RoutedEventArgs e)
        {
            postShare = ((Post)((Button)sender).Tag);

            DataTransferManager.ShowShareUI();
        }