Agregar BasedOn Style en App.xaml se bloquea en App () {InitializeComponent (); }
Adaptando un proyecto aPlantilla10, Entro en estilos heredados en App.xaml están fallando.
Parece quePlantilla10, no admite estilos heredados o extendidos. Estaba tratando de extenderSubTitleStyle deTítuloEstilo pero obtengo una excepción COM enGetXamlType enXamlTypeInfo.g.cs
Mi aplicación.xaml.cs
sealed partial class App : BootStrapper
{
public App() { InitializeComponent(); }
public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args)
{
NavigationService.Navigate(typeof(ShellView))
await Task.CompletedTask;
}
}
My App.xaml
<Style x:Key="TitleStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextTitleForeground}"/>
<Setter Property="FontSize" Value="26"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="FontWeight" Value="Medium"/>
</Style>
<Style x:Key="SubTitleStyle" TargetType="TextBlock" BasedOn="{StaticResource TitleStyle}">
<Setter Property="Foreground" Value="{StaticResource TextForeground}"/>
<Setter Property="FontSize" Value="20"/>
</Style>
Información de excepción:
Error HRESULT E_FAIL has been returned from a call to a COM component.
at System.Runtime.InteropServices.WindowsRuntime.IIterator`1.MoveNext()
at System.Runtime.InteropServices.WindowsRuntime.IteratorToEnumeratorAdapter`1.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
at Template10.Common.BootStrapper.<InitializeFrameAsync>d__77.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Template10.Common.BootStrapper.<InternalLaunchAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()