CalendarView.MAUI 1.1.0

dotnet add package CalendarView.MAUI --version 1.1.0                
NuGet\Install-Package CalendarView.MAUI -Version 1.1.0                
此命令旨在在 Visual Studio 的包管理器控制台中使用,因为它使用 NuGet 模块的 Install-Package 版本。
<PackageReference Include="CalendarView.MAUI" Version="1.1.0" />                
对于支持 PackageReference 的项目,将此 XML 节点复制到项目文件中以引用包。
paket add CalendarView.MAUI --version 1.1.0                
#r "nuget: CalendarView.MAUI, 1.1.0"                
#r 指令可用于 F# Interactive 和 Polyglot Notebooks。将此复制到交互式工具或脚本的源代码中以引用包。
// Install CalendarView.MAUI as a Cake Addin
#addin nuget:?package=CalendarView.MAUI&version=1.1.0

// Install CalendarView.MAUI as a Cake Tool
#tool nuget:?package=CalendarView.MAUI&version=1.1.0                

Calendar.MAUI

在代码中创建日历
using CalendarView.MAUI;

...

public CalendarView MyCalendar { get; set; } = new CalendarView();

...

MyCalendar.SelectionChanged += MyCalendar_SelectionChanged;

...

    private void MyCalendar_SelectionChanged(object sender, EventArgs e)
    {
        Debug.WriteLine($"Selected day = {MyCalendar.SelectedDate}");
    }

将以下 xmlns 添加到您的页面或视图中
xmlns:cc="clr-namespace:CalendarView.MAUI;assembly=CalendarView.MAUI"
在您的 xaml 中使用和自定义日历
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:cc="clr-namespace:CalendarView.MAUI;assembly=CalendarView.MAUI"
             x:Name="mainPage"
             x:Class="Calendar.MAUI.Test.MainPage" Background="white">
    <ContentPage.Resources>
        <Style TargetType="Label" x:Key="CalendarMonthStyle">
            <Setter Property="HorizontalOptions" Value="Center"/>
            <Setter Property="VerticalOptions" Value="Center"/>
            <Setter Property="TextColor" Value="White"/>
            <Setter Property="FontSize" Value="15"/>
            <Setter Property="FontAttributes" Value="Bold"/>
        </Style>
        <Style TargetType="cc:CalendarDayView" x:Key="CalendarEvent1">
            <Setter Property="DayTagStrokeThickness" Value="0"/>
            <Setter Property="DayTagFillColor" Value="orange"/>
            <Setter Property="DayTagWidthRequest" Value="8"/>
            <Setter Property="DayTagHeightRequest" Value="8"/>
            <Setter Property="DayTagHorizontalOptions" Value="Center"/>
            <Setter Property="DayTagVerticalOptions" Value="End"/>
            <Setter Property="DayTagMargin" Value="0,0,0,3"/>
            <Setter Property="DayTagIsVisible" Value="True"/>
        </Style>
        <Style TargetType="cc:CalendarDayView" x:Key="CalendarEvent2">
            <Setter Property="DayTagStrokeThickness" Value="0"/>
            <Setter Property="DayTagFillColor" Value="green"/>
            <Setter Property="DayTagWidthRequest" Value="8"/>
            <Setter Property="DayTagHeightRequest" Value="8"/>
            <Setter Property="DayTagHorizontalOptions" Value="Center"/>
            <Setter Property="DayTagVerticalOptions" Value="End"/>
            <Setter Property="DayTagMargin" Value="0,0,0,3"/>
            <Setter Property="DayTagIsVisible" Value="True"/>
        </Style>
        <Style TargetType="cc:CalendarDayView" x:Key="CalendarEvent3">
            <Setter Property="DayTagStrokeThickness" Value="0"/>
            <Setter Property="DayTagFillColor" Value="brown"/>
            <Setter Property="DayTagWidthRequest" Value="8"/>
            <Setter Property="DayTagHeightRequest" Value="8"/>
            <Setter Property="DayTagHorizontalOptions" Value="Center"/>
            <Setter Property="DayTagVerticalOptions" Value="End"/>
            <Setter Property="DayTagMargin" Value="0,0,0,3"/>
            <Setter Property="DayTagIsVisible" Value="True"/>
        </Style>
        <Style TargetType="cc:CalendarDayView" x:Key="CalendarFirstDayOfWeek">
            <Setter Property="DayColor" Value="Red"/>
        </Style>
        <Style TargetType="cc:CalendarDayNameView" x:Key="CalendarFirstDayOfWeekName">
            <Setter Property="DayNameColor" Value="Red"/>
        </Style>
    </ContentPage.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <cc:CalendarView x:Name="EN_Calendar" BindingContext="{x:Reference mainPage}" Grid.Row="0" Background="white"
                         CalendarEvents="{Binding Events}" WidthRequest="300" HeightRequest="300"
                         MonthStyle="{StaticResource Key=CalendarMonthStyle}" MinSelectedDate="{Binding MinDay}" SelectedDate="{Binding SelectedDay, Mode=TwoWay}"
                         HeaderBackground="blue" MonthFormat="MMMM yyyy" ButtonsColor="White"
                         CalendarCulture="{Binding CalendarCulture}" FirstDayOfWeekStyle="{StaticResource Key=CalendarFirstDayOfWeek}" DayNameFirstDayOfWeekStyle="{StaticResource Key=CalendarFirstDayOfWeekName}"
                         Event1DayStyle="{StaticResource Key=CalendarEvent1}" Event2DayStyle="{StaticResource Key=CalendarEvent2}" Event3DayStyle="{StaticResource Key=CalendarEvent3}"
                         ShowChangeMonthArrows="True" ButtonsScale="1" IsVisible="true"/>
        <cc:CalendarView Grid.Row="1" BindingContext="{x:Reference mainPage}" CalendarEvents="{Binding Events}" ShowChangeMonthArrows="False" Background="white"
                         WidthRequest="300" HeightRequest="300" SelectedDate="{Binding SelectedDay, Mode=TwoWay}"
                         LastDayOfWeekStyle="{StaticResource Key=CalendarFirstDayOfWeek}" DayNameLastDayOfWeekStyle="{StaticResource Key=CalendarFirstDayOfWeekName}"/>
    </Grid>

</ContentPage>
产品 兼容和额外的计算目标框架版本。
.NET net7.0 兼容。 net7.0-android 已计算。 net7.0-android33.0 兼容。 net7.0-ios 已计算。 net7.0-ios16.1 兼容。 net7.0-maccatalyst 已计算。 net7.0-maccatalyst16.1 兼容。 net7.0-macos 已计算。 net7.0-tvos 已计算。 net7.0-windows 已计算。 net7.0-windows10.0.19041 兼容。 net8.0 已计算。 net8.0-android 已计算。 net8.0-browser 已计算。 net8.0-ios 已计算。 net8.0-maccatalyst 已计算。 net8.0-macos 已计算。 net8.0-tvos 已计算。 net8.0-windows 已计算。
兼容目标框架
包含目标框架(在包中)
了解有关 目标框架.NET Standard 的更多信息。
  • net7.0

    • 无依赖。
  • net7.0-android33.0

    • 无依赖。
  • net7.0-ios16.1

    • 无依赖。
  • net7.0-maccatalyst16.1

    • 无依赖。
  • net7.0-windows10.0.19041

    • 无依赖。

NuGet 包 (1)

显示依赖于 CalendarView.MAUI 的前 1 个 NuGet 包

下载
DateTimePicker.MAUI

一个为 .NET MAUI 提供自定义 DateTimePicker 控件的插件

GitHub 存储库

此包未被任何流行的 GitHub 存储库使用。

版本 下载 最后更新
1.1.0 1,398 2/18/2023
1.0.0 250 2/3/2023