Files
BeWoPlaner/BeWo/View/Controls/MonthPicker.xaml.cs
2025-11-28 13:15:38 +01:00

36 lines
947 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using BeWo.ViewModel;
namespace BeWo.View.Controls
{
/// <summary>
/// Interaction logic for MonthPicker.xaml
/// </summary>
public partial class MonthPicker : UserControl
{
public MonthPicker()
{
InitializeComponent();
_MonthPicker.ItemsSource = DateTimeFormatInfo.CurrentInfo.MonthNames.Where(s => !string.IsNullOrEmpty(s));
_MonthPicker.SelectedIndex = 0;
}
public int SelectedMonth
{
get => _MonthPicker.SelectedIndex + 1;
set => _MonthPicker.SelectedIndex = value - 1;
}
public string SelectedMonthName
{
get => (string)_MonthPicker.SelectedItem;
}
}
}