-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExpenseReportPage.xaml.cs
More file actions
35 lines (30 loc) · 1.21 KB
/
ExpenseReportPage.xaml.cs
File metadata and controls
35 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Windows.Automation.Peers;
using System.Windows.Controls;
namespace ExpenseIt
{
/// <summary>
/// Interaction logic for ExpenseReportPage.xaml
/// </summary>
public partial class ExpenseReportPage : Page
{
public ExpenseReportPage()
{
InitializeComponent();
}
// Custom constructor to pass expense report data
public ExpenseReportPage(object data):this()
{
// Bind to expense report data.
this.DataContext = data;
}
private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
// Trigger live region to be read when loaded.
// Note that we announce two live regions for this page that is so we can trigger screen readers to read
// the text of "Expense Report For" but then also append the actual name of the person we are viewing the
// the report for.
FrameworkElementAutomationPeer.FromElement(LiveRegion)?.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
FrameworkElementAutomationPeer.FromElement(NameLiveRegion)?.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged);
}
}
}