Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 43d89e9

Browse filesBrowse files
devmilpauldotknopf
authored andcommitted
adapted PhotoFrame sample to new Qml.Net
1 parent 36fa9fa commit 43d89e9
Copy full SHA for 43d89e9

File tree

Expand file treeCollapse file tree

5 files changed

+38
-38
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+38
-38
lines changed

‎samples/PhotoFrame/PhotoFrame.App/PhotoFrame.App.csproj

Copy file name to clipboardExpand all lines: samples/PhotoFrame/PhotoFrame.App/PhotoFrame.App.csproj
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>netcoreapp2.1</TargetFramework>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Qml.Net" Version="0.1.1" />
7+
<PackageReference Include="Qml.Net" Version="0.1.3" />
88
</ItemGroup>
99
<ItemGroup>
1010
<ProjectReference Include="..\PhotoFrame.Logic\PhotoFrame.Logic.csproj" />

‎samples/PhotoFrame/PhotoFrame.Logic/UI/QML/ViewBorder.qml

Copy file name to clipboardExpand all lines: samples/PhotoFrame/PhotoFrame.Logic/UI/QML/ViewBorder.qml
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ Item {
99

1010
Rectangle {
1111
anchors.fill: parent
12-
color: viewModel.BorderColor
12+
color: viewModel.borderColor
1313
}
1414

1515
Image {
1616
anchors.fill: parent
17-
anchors.topMargin: viewModel.BorderWidth
18-
anchors.bottomMargin: viewModel.BorderWidth
19-
anchors.leftMargin: viewModel.BorderWidth
20-
anchors.rightMargin: viewModel.BorderWidth
17+
anchors.topMargin: viewModel.borderWidth
18+
anchors.bottomMargin: viewModel.borderWidth
19+
anchors.leftMargin: viewModel.borderWidth
20+
anchors.rightMargin: viewModel.borderWidth
2121
fillMode: Image.PreserveAspectFit
2222
id: imgPhoto
23-
source: viewModel.ImageUri
23+
source: viewModel.imageUri
2424
visible: false
2525
}
2626

‎samples/PhotoFrame/PhotoFrame.Logic/UI/QML/ViewColorized.qml

Copy file name to clipboardExpand all lines: samples/PhotoFrame/PhotoFrame.Logic/UI/QML/ViewColorized.qml
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Item {
1010
anchors.fill: parent
1111
fillMode: Image.PreserveAspectFit
1212
id: imgPhoto
13-
source: viewModel.ImageUri
13+
source: viewModel.imageUri
1414
visible: false
1515
}
1616

1717
Colorize {
1818
anchors.fill: imgPhoto
1919
source: imgPhoto
20-
hue: viewModel.Hue
21-
saturation: viewModel.Saturation
22-
lightness: viewModel.Lightness
20+
hue: viewModel.hue
21+
saturation: viewModel.saturation
22+
lightness: viewModel.lightness
2323
}
2424
}

‎samples/PhotoFrame/PhotoFrame.Logic/UI/QML/ViewNormal.qml

Copy file name to clipboardExpand all lines: samples/PhotoFrame/PhotoFrame.Logic/UI/QML/ViewNormal.qml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Item {
99
anchors.fill: parent
1010
fillMode: Image.PreserveAspectFit
1111
id: imgPhoto
12-
source: viewModel.ImageUri
12+
source: viewModel.imageUri
1313
}
1414
}

‎samples/PhotoFrame/PhotoFrame.Logic/UI/QML/main.qml

Copy file name to clipboardExpand all lines: samples/PhotoFrame/PhotoFrame.Logic/UI/QML/main.qml
+26-26Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ ApplicationWindow {
3333

3434
ParallelAnimation {
3535
id: animMoveUp
36-
PropertyAnimation { target: animator.secondaryLoader; properties: "y"; to: -height; duration: appModel.AnimationDurationMs }
37-
PropertyAnimation { target: animator.mainLoader; properties: "y"; to: 0; duration: appModel.AnimationDurationMs }
36+
PropertyAnimation { target: animator.secondaryLoader; properties: "y"; to: -height; duration: appModel.animationDurationMs }
37+
PropertyAnimation { target: animator.mainLoader; properties: "y"; to: 0; duration: appModel.animationDurationMs }
3838
onRunningChanged: {
3939
if(!running) {
4040
animator.endAnimation(animMoveUp);
@@ -44,8 +44,8 @@ ApplicationWindow {
4444

4545
ParallelAnimation {
4646
id: animMoveRight
47-
PropertyAnimation { target: animator.secondaryLoader; properties: "x"; to: width; duration: appModel.AnimationDurationMs }
48-
PropertyAnimation { target: animator.mainLoader; properties: "x"; to: 0; duration: appModel.AnimationDurationMs }
47+
PropertyAnimation { target: animator.secondaryLoader; properties: "x"; to: width; duration: appModel.animationDurationMs }
48+
PropertyAnimation { target: animator.mainLoader; properties: "x"; to: 0; duration: appModel.animationDurationMs }
4949
onRunningChanged: {
5050
if(!running) {
5151
animator.endAnimation(animMoveRight);
@@ -55,9 +55,9 @@ ApplicationWindow {
5555

5656
ParallelAnimation {
5757
id: animMoveRightAndRotate
58-
PropertyAnimation { target: animator.secondaryLoader; properties: "x"; to: width; duration: appModel.AnimationDurationMs }
59-
PropertyAnimation { target: animator.mainLoader; properties: "x"; to: 0; duration: appModel.AnimationDurationMs }
60-
RotationAnimation { targets: [animator.secondaryLoader, animator.mainLoader]; from: 0; to: 360; duration: appModel.AnimationDurationMs }
58+
PropertyAnimation { target: animator.secondaryLoader; properties: "x"; to: width; duration: appModel.animationDurationMs }
59+
PropertyAnimation { target: animator.mainLoader; properties: "x"; to: 0; duration: appModel.animationDurationMs }
60+
RotationAnimation { targets: [animator.secondaryLoader, animator.mainLoader]; from: 0; to: 360; duration: appModel.animationDurationMs }
6161
onRunningChanged: {
6262
if(!running) {
6363
animator.endAnimation(animMoveRightAndRotate);
@@ -67,8 +67,8 @@ ApplicationWindow {
6767

6868
SequentialAnimation {
6969
id: animFade
70-
NumberAnimation { target: animator.secondaryLoader; properties: "opacity"; to: 0; duration: appModel.AnimationDurationMs / 2 }
71-
NumberAnimation { target: animator.mainLoader; properties: "opacity"; to: 1; duration: appModel.AnimationDurationMs / 2 }
70+
NumberAnimation { target: animator.secondaryLoader; properties: "opacity"; to: 0; duration: appModel.animationDurationMs / 2 }
71+
NumberAnimation { target: animator.mainLoader; properties: "opacity"; to: 1; duration: appModel.animationDurationMs / 2 }
7272
onRunningChanged: {
7373
if(!running) {
7474
animator.endAnimation(animFade);
@@ -78,8 +78,8 @@ ApplicationWindow {
7878

7979
SequentialAnimation {
8080
id: animScale
81-
NumberAnimation { target: animator.secondaryLoader; properties: "scale"; to: 0; duration: appModel.AnimationDurationMs / 2 }
82-
NumberAnimation { target: animator.mainLoader; properties: "scale"; to: 1; duration: appModel.AnimationDurationMs / 2 }
81+
NumberAnimation { target: animator.secondaryLoader; properties: "scale"; to: 0; duration: appModel.animationDurationMs / 2 }
82+
NumberAnimation { target: animator.mainLoader; properties: "scale"; to: 1; duration: appModel.animationDurationMs / 2 }
8383
onRunningChanged: {
8484
if(!running) {
8585
animator.endAnimation(animScale);
@@ -202,29 +202,29 @@ ApplicationWindow {
202202
}
203203

204204
function updateViewData(){
205-
if(animator.mainLoader.source !== appModel.CurrentViewSwitchInfo.ViewResourceId) {
206-
var switchType = appModel.CurrentViewSwitchInfo.SwitchTypeString;
205+
if(animator.mainLoader.source !== appModel.currentViewSwitchInfo.viewResourceId) {
206+
var switchType = appModel.currentViewSwitchInfo.switchTypeString;
207207
switch(switchType) {
208208
case "Fade":
209-
animator.switchViewFade(appModel.CurrentViewSwitchInfo.ViewResourceId, appModel.CurrentViewSwitchInfo.ViewModel);
209+
animator.switchViewFade(appModel.currentViewSwitchInfo.viewResourceId, appModel.currentViewSwitchInfo.viewModel);
210210
break;
211211
case "Vertical":
212-
animator.switchViewVertical(appModel.CurrentViewSwitchInfo.ViewResourceId, appModel.CurrentViewSwitchInfo.ViewModel);
212+
animator.switchViewVertical(appModel.currentViewSwitchInfo.viewResourceId, appModel.currentViewSwitchInfo.viewModel);
213213
break;
214214
case "Horizontal":
215-
animator.switchViewHorizontal(appModel.CurrentViewSwitchInfo.ViewResourceId, appModel.CurrentViewSwitchInfo.ViewModel);
215+
animator.switchViewHorizontal(appModel.currentViewSwitchInfo.viewResourceId, appModel.currentViewSwitchInfo.viewModel);
216216
break;
217217
case "RotateAndMove":
218-
animator.switchViewRotateAndMove(appModel.CurrentViewSwitchInfo.ViewResourceId, appModel.CurrentViewSwitchInfo.ViewModel);
218+
animator.switchViewRotateAndMove(appModel.currentViewSwitchInfo.viewResourceId, appModel.currentViewSwitchInfo.viewModel);
219219
break;
220220
case "Scale":
221-
animator.switchViewScale(appModel.CurrentViewSwitchInfo.ViewResourceId, appModel.CurrentViewSwitchInfo.ViewModel);
221+
animator.switchViewScale(appModel.currentViewSwitchInfo.viewResourceId, appModel.currentViewSwitchInfo.viewModel);
222222
break;
223223
case "None":
224-
animator.switchViewHard(appModel.CurrentViewSwitchInfo.ViewResourceId, appModel.CurrentViewSwitchInfo.ViewModel);
224+
animator.switchViewHard(appModel.currentViewSwitchInfo.viewResourceId, appModel.currentViewSwitchInfo.viewModel);
225225
break;
226226
default:
227-
animator.switchViewHard(appModel.CurrentViewSwitchInfo.ViewResourceId, appModel.CurrentViewSwitchInfo.ViewModel);
227+
animator.switchViewHard(appModel.currentViewSwitchInfo.viewResourceId, appModel.currentViewSwitchInfo.viewModel);
228228
break;
229229
}
230230
}
@@ -233,7 +233,7 @@ ApplicationWindow {
233233
AppModel {
234234
id: appModel
235235
Component.onCompleted: {
236-
appModel.CurrentViewSwitchInfoChanged.connect(updateViewData)
236+
appModel.currentViewSwitchInfoChanged.connect(updateViewData)
237237
}
238238
}
239239

@@ -263,7 +263,7 @@ ApplicationWindow {
263263
height: parent.height
264264
width: parent.width
265265
x: 0
266-
visible: appModel.ShowDebugInfo
266+
visible: appModel.showDebugInfo
267267

268268
Rectangle {
269269
id: viewName
@@ -277,7 +277,7 @@ ApplicationWindow {
277277
Text {
278278
anchors.centerIn: parent
279279
id: txtViewName
280-
text: appModel.CurrentViewName
280+
text: appModel.currentViewName
281281
font.pointSize: 8
282282
color: "white"
283283
}
@@ -305,7 +305,7 @@ ApplicationWindow {
305305
Text {
306306
anchors.centerIn: parent
307307
id: txtSwitchType
308-
text: appModel.CurrentSwitchTypeName
308+
text: appModel.currentSwitchTypeName
309309
font.pointSize: 8
310310
color: "white"
311311
}
@@ -333,7 +333,7 @@ ApplicationWindow {
333333
Text {
334334
anchors.centerIn: parent
335335
id: txtMemoryUsage
336-
text: appModel.CurrentlyUsedMBString
336+
text: appModel.currentlyUsedMBString
337337
font.pointSize: 10
338338
color: "white"
339339
}
@@ -361,7 +361,7 @@ ApplicationWindow {
361361
Text {
362362
anchors.centerIn: parent
363363
id: txtCountDown
364-
text: appModel.TimerValue
364+
text: appModel.timerValue
365365
font.pointSize: 16
366366
color: "white"
367367
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.