Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace uses of the deprecated IStyleable with StyleKeyOverride #310

Merged
merged 1 commit into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Avalonia.FuncUI/Components/Component.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ open System
open Avalonia.Controls
open Avalonia.FuncUI
open Avalonia.FuncUI.Types
open Avalonia.Styling
open Avalonia.FuncUI.VirtualDom
open Avalonia.Threading

Expand Down Expand Up @@ -63,8 +62,7 @@ type Component (render: IComponentContext -> IView) as this =
base.Finalize ()
(context :> IDisposable).Dispose ()

interface IStyleable with
member this.StyleKey = typeof<Border>
override this.StyleKeyOverride = typeof<Border>

type Component with

Expand Down
4 changes: 1 addition & 3 deletions src/Avalonia.FuncUI/Components/StaticComponent.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ namespace Avalonia.FuncUI
open Avalonia
open Avalonia.Controls
open Avalonia.FuncUI.Types
open Avalonia.Styling

[<AbstractClass>]
[<Experimental "Statically construct views with F#">]
Expand All @@ -21,5 +20,4 @@ type StaticComponent () =

abstract member Build: unit -> IView

interface IStyleable with
member this.StyleKey = typeof<Border>
override this.StyleKeyOverride = typeof<Border>
3 changes: 1 addition & 2 deletions src/Avalonia.FuncUI/Environment.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ type EnvironmentStateProvider<'value>

member this.ProvidedState with get () = providedState

interface IStyleable with
member this.StyleKey = typeof<ContentControl>
override this.StyleKeyOverride = typeof<ContentControl>

type EnvironmentStateProvider<'value> with

Expand Down
3 changes: 1 addition & 2 deletions src/Avalonia.FuncUI/Hosts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ type HostControl() as this =
VirtualDom.updateRoot (this, lastViewElement, nextViewElement)
lastViewElement <- nextViewElement

interface IStyleable with
member this.StyleKey = typeof<ContentControl>
override this.StyleKeyOverride = typeof<ContentControl>

interface IViewHost with
member this.Update next =
Expand Down