Elements. Build native projects for any modern development platform, using the language(s) of your choice. Oxygene (Object Pascal), C#, Swift, Java, Go. | RemObjects Software

SharedUI.Shared

Language: Oxygene, Platform: All, Category: SharedUI
https://github.com/remobjects/ElementsSamples/tree/master/Oxygene/All/SharedUI/SharedUI.Shared

$(MSBuildThisFileDirectory)MainWindow.xaml.pas

namespace SharedUI.Shared;
{$IF ECHOES}

uses
  System.Windows,
  System.Windows.Controls;

type
  MainWindow = public partial class(System.Windows.Window)
  public

    constructor withController(aController: MainWindowController);
    begin
      DataContext := aController;
      InitializeComponent();
    end;

  private
    property controller: MainWindowController read DataContext as MainWindowController;

    //
    // Forward actions to the controller
    //

    method CalculateResult_Click(aSender: Object; e: RoutedEventArgs);
    begin
      controller.calculateResult(aSender);
    end;

  end;

{$ENDIF}
end.