zoukankan      html  css  js  c++  java
  • XF 开关控件

    <?xml version="1.0" encoding="utf-8" ?>
    <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:App20"
                 x:Class="App20.MainPage">

        <StackLayout x:Name="sl" VerticalOptions="Center">
            <Switch x:Name="sw" Toggled="Switch_Toggled"></Switch>
        </StackLayout>

    </ContentPage>

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Xamarin.Forms;

    namespace App20
    {
        public partial class MainPage : ContentPage
        {
            public MainPage()
            {
                InitializeComponent();
            }

            private void Switch_Toggled(object sender, ToggledEventArgs e)
            {
                if (sw.IsToggled)
                {
                    sl.BackgroundColor = Color.Red;
                }
                else
                {
                    sl.BackgroundColor = Color.Yellow;

                }
            }
        }
    }
     

  • 相关阅读:
    bzoj2732[HNOI2012]射箭
    poj1474 Video Surveillance
    bzoj3167[HEOI2013]SAO
    hdu2296 Ring
    bzoj2119 股市的预测
    bzoj2244[SDOI2011]拦截导弹
    bzoj3502[PA2012]Tanie Linie(最大k区间和)
    vijos1859[TJOI2014]电源插排
    比较SQL查询性能 语句
    什么是高内聚低耦合
  • 原文地址:https://www.cnblogs.com/dxmfans/p/9434582.html
Copyright © 2011-2022 走看看