Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Datetime-Picker #146

Open
Strypper opened this issue Jun 29, 2023 · 0 comments
Open

🚀 Datetime-Picker #146

Strypper opened this issue Jun 29, 2023 · 0 comments
Labels
community 🤝 Controls or libraries that came from github community effort/medium Medium amount of work, 4h to 16h action level/normal 🙂 In comfort zone, little research and may require using built-in features, but no RnD

Comments

@Strypper
Copy link
Owner

Strypper commented Jun 29, 2023

Scope

image

References

(Youtube)[https://www.youtube.com/watch?v=fXZfVvkg0uA&t=4s]
(Source code)[https://github.com/samir05051994/Datetime-Picker]

Public API Changes

    <LayoutComponentViews:PickerView
        HorizontalOptions="FillAndExpand"
        x:Name="MonthPicker"
        SelectedValue="{Binding Source={x:Reference datetimepickerview},Path=SelectedMonth,Mode=TwoWay}"
        PickerList="{Binding Source={x:Reference datetimepickerview},Path=MonthPickerList}">
        <LayoutComponentViews:PickerView.Triggers>
            <Trigger 
                TargetType="LayoutComponentViews:PickerView"
                Property="IsVisible" 
                Value="False">
                <Setter 
                    Property="HorizontalOptions" 
                    Value="Fill"/>
            </Trigger>
        </LayoutComponentViews:PickerView.Triggers>
    </LayoutComponentViews:PickerView>

    <LayoutComponentViews:PickerView 
        Grid.Column="1"
        x:Name="DayPicker"
        HorizontalOptions="FillAndExpand"
        SelectedValue="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:dd}'}"
        PickerList="{Binding Source={x:Reference datetimepickerview},Path=DayPickerList}">
        <LayoutComponentViews:PickerView.Triggers>
            <Trigger 
                TargetType="LayoutComponentViews:PickerView"
                Property="IsVisible" 
                Value="False">
                <Setter
                    Property="HorizontalOptions" 
                    Value="Fill"/>
            </Trigger>
        </LayoutComponentViews:PickerView.Triggers>
    </LayoutComponentViews:PickerView>

    <LayoutComponentViews:PickerView
        Grid.Column="2"
        x:Name="YearPicker"
        HorizontalOptions="FillAndExpand"
        SelectedValue="{Binding Source={x:Reference datetimepickerview},Path=SelectedYear,Mode=TwoWay}"
        PickerList="{Binding Source={x:Reference datetimepickerview},Path=YearPickerList}">
        <LayoutComponentViews:PickerView.Triggers>
            <Trigger 
                TargetType="LayoutComponentViews:PickerView"
                Property="IsVisible" 
                Value="False">
                <Setter
                    Property="HorizontalOptions"
                    Value="Fill"/>
            </Trigger>
        </LayoutComponentViews:PickerView.Triggers>
    </LayoutComponentViews:PickerView>

    <Label 
        Grid.Column="3"
        Padding="{OnIdiom Phone='10,0',Tablet='20,0'}"
        IsVisible="{Binding Source={x:Reference datetimepickerview},Path=IsTimeVisible}"/>

    <LayoutComponentViews:PickerView 
        Grid.Column="4"
        x:Name="HourPicker"
        HorizontalOptions="FillAndExpand"
        SelectedValue="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:HH}'}"
        PickerList="{Binding Source={x:Reference datetimepickerview},Path=HourPickerList}"
        IsVisible="{Binding Source={x:Reference datetimepickerview},Path=IsTimeVisible}">
        <LayoutComponentViews:PickerView.Triggers>
            <Trigger 
                TargetType="LayoutComponentViews:PickerView"
                Property="IsVisible" 
                Value="False">
                <Setter
                    Property="HorizontalOptions"
                    Value="Fill"/>
            </Trigger>
        </LayoutComponentViews:PickerView.Triggers>
    </LayoutComponentViews:PickerView>

    <Label 
        Grid.Column="5"
        Style="{StaticResource PrimaryLblStyle}" 
        Text=":"
        IsVisible="{Binding Source={x:Reference datetimepickerview},Path=IsTimeVisible}"/>

    <LayoutComponentViews:PickerView
        Grid.Column="6"
        x:Name="MinutePicker"
        HorizontalOptions="FillAndExpand"
        SelectedValue="{Binding Source={x:Static sys:DateTime.Now}, StringFormat='{0:mm}'}"
        PickerList="{Binding Source={x:Reference datetimepickerview},Path=MinPickerList}"
        IsVisible="{Binding Source={x:Reference datetimepickerview},Path=IsTimeVisible}">
        <LayoutComponentViews:PickerView.Triggers>
            <Trigger 
                TargetType="LayoutComponentViews:PickerView"
                Property="IsVisible" 
                Value="False">
                <Setter 
                    Property="HorizontalOptions" 
                    Value="Fill"/>
            </Trigger>
        </LayoutComponentViews:PickerView.Triggers>
    </LayoutComponentViews:PickerView>```

### Intended Use-Case

Replace the stupid built-in date picker
@Strypper Strypper added level/normal 🙂 In comfort zone, little research and may require using built-in features, but no RnD community 🤝 Controls or libraries that came from github community effort/medium Medium amount of work, 4h to 16h action labels Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community 🤝 Controls or libraries that came from github community effort/medium Medium amount of work, 4h to 16h action level/normal 🙂 In comfort zone, little research and may require using built-in features, but no RnD
Projects
Status: Todo
Development

No branches or pull requests

1 participant