问题描述
我的页面中有一个数据网格,它在按下显示按钮后显示数据。 我的 xaml 中的代码:
<DGrd:DataGrid Grid.Row="1"
ItemsSource="{Binding LeaveBalances}"
SelectionEnabled="False" HeaderLabelStyle="{StaticResource HeaderlabelStyle}">
<DGrd:DataGrid.Columns>
<DGrd:DataGridColumn Title="Leave" PropertyName="LeaveName" />
<DGrd:DataGridColumn Title="opening" PropertyName="opening" StringFormat="{}{0:N1}" />
<DGrd:DataGridColumn Title="Availed" PropertyName="Availed" StringFormat="{}{0:N1}" />
<DGrd:DataGridColumn Title="Balance" PropertyName="Balance" StringFormat="{}{0:N1}" />
</DGrd:DataGrid.Columns>
</DGrd:DataGrid>
我的视图模型:
private async Task RefreshView()
{
BusyStatus = "Loading Leave Balance";
await InvokeAsync(() => oLeaveService.GetCurrentLeaveYear(),(lvYear) => { LeaveYear = lvYear; });
await InvokeAsync(() => oLeaveService.GetEmpLeaveBalance(User.CurrentUser.PKID),LeaveBalanceGet_Completed);
}
我的应用程序在调试模式下运行良好。但是按钮在释放模式下没有任何反应。 我能在这件事上做什么?
附言:我尝试在发布模式下使链接器属性无。但在那种情况下,我的存档失败了。
解决方法
刚刚发现我在我的数据网格中使用了样式,这导致它在发布模式下没有任何响应。不知道为什么。 在我注释掉这部分后它工作正常:
<Style TargetType="DGrd:DataGrid">
<Setter Property="FontFamily">
<Setter.Value>
<OnPlatform x:TypeArguments="x:String">
<OnPlatform.iOS>Lato-Regular</OnPlatform.iOS>
<OnPlatform.Android>Lato-Regular.ttf#Lato-Regular</OnPlatform.Android>
<OnPlatform.WinPhone>Assets/Fonts/Lato-Regular.ttf#Lato</OnPlatform.WinPhone>
</OnPlatform>
</Setter.Value>
</Setter>
<Setter Property="HeaderHeight" Value="50" />
<Setter Property="FontSize" Value="15" />
<Setter Property="HeaderFontSize" Value="15" />
<Setter Property="HeaderBackground" Value="{x:Static constants:SystemColors.ListHeaderBackColor}" />
<Setter Property="BorderColor" Value="{x:Static constants:SystemColors.GridBorderColor}" />
</Style>