Skip to content

Commit

Permalink
Try to get the control catalog working in NativeAOT builds (#423)
Browse files Browse the repository at this point in the history
* Try to get the control catalog working in NativeAOT builds

* Replace another sprintf with a string interpolation
  • Loading branch information
Numpsy authored Sep 24, 2024
1 parent f39980a commit f156f6e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
<ProjectReference Include="..\Avalonia.FuncUI.ControlCatalog\Avalonia.FuncUI.ControlCatalog.fsproj" />
</ItemGroup>

<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.FuncUI.ControlCatalog" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ module DataTemplateDemo =
TextBlock.create [
TextBlock.dock Dock.Top
TextBlock.margin 5.0
TextBlock.text (sprintf "Total Products: %i" state.Products.Length)
TextBlock.text ($"Total Products: %i{state.Products.Length}")
]

productDetailsView state.Selected dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module DragDropDemo =
let doDrag (e, dragCount) =
async {
let dragData = DataObject()
dragData.Set(DataFormats.Text, sprintf "You have dragged text %d times" dragCount)
dragData.Set(DataFormats.Text, $"You have dragged text %d{dragCount} times")

let! result = Dispatcher.UIThread.InvokeAsync<DragDropEffects>
(fun _ -> DragDrop.DoDragDrop(e, dragData, DragDropEffects.Copy)) |> Async.AwaitTask
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ module GridDemo =
)
]
Grid.create [
Grid.columnDefinitions (sprintf "%i, 1*" state.cellWidth)
Grid.rowDefinitions (sprintf "%i, 1*" state.cellHeight)
Grid.columnDefinitions ($"%i{state.cellWidth}, 1*")
Grid.rowDefinitions ($"%i{state.cellHeight}, 1*")
Grid.showGridLines true
Grid.children [
Border.create [
Expand Down

0 comments on commit f156f6e

Please sign in to comment.