Skip to content

Commit

Permalink
feat: Use newly added resources
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Dec 1, 2023
1 parent c47e54f commit 082bfaf
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 432 deletions.
27 changes: 12 additions & 15 deletions src/Uno.UI/UI/Xaml/Controls/DatePicker/DatePicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.ObjectModel;
using System.Text;
using System.Threading.Tasks;
using DirectUI;
using Uno.Disposables;
using Uno.UI.Helpers.WinUI;
using Windows.ApplicationModel.Resources;
Expand Down Expand Up @@ -331,7 +332,7 @@ protected override void OnApplyTemplate()

string strAutomationName;
string strParentAutomationName;
// string strComboAutomationName;
string strComboAutomationName;

//Clean up existing parts
if (m_tpDayPicker != null)
Expand Down Expand Up @@ -448,8 +449,7 @@ protected override void OnApplyTemplate()
spHeaderAsInspectable = Header;
if (spHeaderAsInspectable != null)
{
// UNO TODO
// (FrameworkElement.GetStringFromObject(spHeaderAsInspectable, strParentAutomationName));
strParentAutomationName = FrameworkElement.GetStringFromObject(spHeaderAsInspectable);
}
}
// Hook up the selection changed events for selectors, we will be reacting to these events.
Expand All @@ -462,10 +462,9 @@ protected override void OnApplyTemplate()
strAutomationName = AutomationProperties.GetName(m_tpDayPicker);
if (strAutomationName == null)
{
// UNO TODO
//(DXamlCore.GetCurrentNoCreate().GetLocalizedResourceString(UIA_DATEPICKER_DAY, strAutomationName));
//strAutomationName += strParentAutomationName + strComboAutomationName;
//AutomationProperties.SetName(m_tpDayPicker as ComboBox, strComboAutomationName);
strAutomationName = DXamlCore.Current.GetLocalizedResourceString("UIA_DATEPICKER_DAY");
strComboAutomationName = strAutomationName + strParentAutomationName;
AutomationProperties.SetName(m_tpDayPicker as ComboBox, strComboAutomationName);
}
}
if (m_tpMonthPicker != null)
Expand All @@ -477,10 +476,9 @@ protected override void OnApplyTemplate()
strAutomationName = AutomationProperties.GetName(m_tpMonthPicker as ComboBox);
if (strAutomationName == null)
{
// UNO TODO
//(DXamlCore.GetCurrentNoCreate().GetLocalizedResourceString(UIA_DATEPICKER_MONTH, strAutomationName));
//strAutomationName += strParentAutomationName + strComboAutomationName;
//AutomationProperties.SetName(m_tpMonthPicker as ComboBox, strComboAutomationName));
strAutomationName = DXamlCore.Current.GetLocalizedResourceString("UIA_DATEPICKER_MONTH");
strComboAutomationName = strAutomationName + strParentAutomationName;
AutomationProperties.SetName(m_tpMonthPicker as ComboBox, strComboAutomationName);
}
}
if (m_tpYearPicker != null)
Expand All @@ -492,10 +490,9 @@ protected override void OnApplyTemplate()
strAutomationName = AutomationProperties.GetName(m_tpYearPicker as ComboBox);
if (strAutomationName == null)
{
// UNO TODO
//DXamlCore.GetCurrentNoCreate().GetLocalizedResourceString(UIA_DATEPICKER_YEAR, strAutomationName);
//strAutomationName += strParentAutomationName + strComboAutomationName;
//AutomationProperties.SetName(m_tpYearPicker as ComboBox, strComboAutomationName);
strAutomationName = DXamlCore.Current.GetLocalizedResourceString("UIA_DATEPICKER_YEAR");
strComboAutomationName = strAutomationName + strParentAutomationName;
AutomationProperties.SetName(m_tpYearPicker as ComboBox, strComboAutomationName);
}
}

Expand Down
144 changes: 0 additions & 144 deletions src/Uno.UI/UI/Xaml/Controls/DatePicker/Strings/en-US/Resources.resw

This file was deleted.

Loading

0 comments on commit 082bfaf

Please sign in to comment.