mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-23 06:25:19 -07:00
Merge pull request #70 from nventive/dev/djo/standard-xload
[Perf] Set x:Load=false for StandardOperators
This commit is contained in:
commit
a1747f758e
3 changed files with 19 additions and 1 deletions
|
@ -301,6 +301,11 @@ namespace CalculatorApp
|
|||
|
||||
void OnIsStandardPropertyChanged(bool oldValue, bool newValue)
|
||||
{
|
||||
if (newValue)
|
||||
{
|
||||
EnsureStandard();
|
||||
}
|
||||
|
||||
UpdateViewState();
|
||||
UpdatePanelViewState();
|
||||
}
|
||||
|
@ -430,6 +435,11 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
void EnsureStandard()
|
||||
{
|
||||
OpsPanel.EnsureStandardOps();
|
||||
}
|
||||
|
||||
void EnsureScientific()
|
||||
{
|
||||
OpsPanel.EnsureScientificOps();
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<Grid>
|
||||
<!--Bind visibility as a workaround for nventive/Uno#925-->
|
||||
<local:CalculatorStandardOperators x:Name="StandardOperators"
|
||||
x:Load="{x:Bind Model.IsStandard, Mode=OneWay}"
|
||||
x:Load="False"
|
||||
IsEnabled="{x:Bind Model.IsStandard, Mode=OneWay}"
|
||||
Visibility="{x:Bind Model.IsStandard, Mode=OneWay}"
|
||||
TabIndex="17" />
|
||||
|
|
|
@ -88,6 +88,14 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
internal void EnsureStandardOps()
|
||||
{
|
||||
if (StandardOperators == null)
|
||||
{
|
||||
this.FindName("StandardOperators");
|
||||
}
|
||||
}
|
||||
|
||||
internal void EnsureScientificOps()
|
||||
{
|
||||
if (ScientificOperators == null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue