This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Globalization; | |
using System.Linq; | |
using System.Net.Mime; | |
using System.Text; | |
using System.Threading.Tasks; | |
using SQLite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JavaFXApplication extends Application { | |
@Override | |
public void start(Stage stage) throws Exception { | |
Parent root = FXMLLoader.load(getClass().getResource("Sample.fxml")); | |
Scene scene = new Scene(root); | |
stage.setScene(scene); | |
stage.show(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import java.lang.*?> | |
<?import java.util.*?> | |
<?import javafx.scene.*?> | |
<?import javafx.scene.control.*?> | |
<?import javafx.scene.layout.*?> | |
<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication3.SampleController"> | |
<children> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...... | |
public class SampleController implements Initializable { | |
@FXML | |
private Label label; | |
@FXML | |
private void handleButtonAction(ActionEvent event) { | |
System.out.println("You clicked me!"); | |
label.setText("Hello World!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SampleController implements Initializable { | |
// Define the property | |
private StringProperty counter = new SimpleStringProperty(); | |
// Define a getter for the property's value | |
public final String getCounter(){return counter.get();} | |
// Define a setter for the property's value | |
public final void setCounter(String value){counter.set(value);} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import java.lang.*?> | |
<?import java.util.*?> | |
<?import javafx.scene.*?> | |
<?import javafx.scene.control.*?> | |
<?import javafx.scene.layout.*?> | |
<AnchorPane id="AnchorPane" prefHeight="200" prefWidth="320" xmlns:fx="http://javafx.com/fxml" fx:controller="javafxapplication.SampleController"> | |
<children> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<phone:PhoneApplicationPage | |
x:Class="KhanAcademyWp8.Views.VideoDetailPage" | |
..... | |
shell:SystemTray.IsVisible="True" DataContext="{Binding Video, Mode=OneWay, Source={StaticResource Locator}}"> | |
<!--LayoutRoot is the root grid where all page content is placed--> | |
<Grid x:Name="LayoutRoot" Background="Transparent"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto"/> | |
<RowDefinition Height="*"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ViewModelLocator | |
{ | |
public ViewModelLocator() | |
{ | |
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); | |
.... | |
if (ViewModelBase.IsInDesignModeStatic)//if in desing time | |
{ | |
SimpleIoc.Default.Register<IKhanAcademyService, DesignKhanAcademyService>(); | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Application x:Class="KhanAcademyWp8.App" | |
..... | |
xmlns:viewModel2="clr-namespace:KhanAcademyWp8.ViewModel" | |
mc:Ignorable="d" > | |
<Application.Resources> | |
<viewModel2:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> | |
... | |
</Application.Resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class VideoViewModel : ViewModelBase | |
{ | |
public RelayCommand Navigate { get; private set; } | |
public string DownloadUrl | |
{ | |
get { return _video.DownloadUrl; } | |
} | |
public string Title | |
{ |
OlderNewer