Xamarin Custom Panels: Size type missing. What references do I need?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I've been following some tutorials to learn Xamarin/Xaml. I'm currently looking at custom panels.
My custom Panel class is currently as follows:
using System;
using System.Collections.Generic;
using System.Text;
using Windows.Foundation;
using Windows.UI.Xaml.Controls;
public class MyCustomPanel : Panel
{
protected override Size MeasureOverride(Size size)
{
return base.MeasureOverride(size);
}
}
With this code i get:
The type or namespace 'Size' could not be found (are you missing a
using directive or an assembly reference?)
Intellisense tells me (hovering over the base MeasureOverride) that the type of Size I'm looking for is Windows.Foundation.Size however I'm already using Windows.Foundation. It does not have a type of Size.
If I try to resolve with intellsence the only Size types availble to me are System.Drawing and Xamarin.Forms. None of these are suitable for MeasureOverride.
Can anyone help with this? What is it that I am missing?
Thanks in advance.
xaml xamarin
|
show 1 more comment
I've been following some tutorials to learn Xamarin/Xaml. I'm currently looking at custom panels.
My custom Panel class is currently as follows:
using System;
using System.Collections.Generic;
using System.Text;
using Windows.Foundation;
using Windows.UI.Xaml.Controls;
public class MyCustomPanel : Panel
{
protected override Size MeasureOverride(Size size)
{
return base.MeasureOverride(size);
}
}
With this code i get:
The type or namespace 'Size' could not be found (are you missing a
using directive or an assembly reference?)
Intellisense tells me (hovering over the base MeasureOverride) that the type of Size I'm looking for is Windows.Foundation.Size however I'm already using Windows.Foundation. It does not have a type of Size.
If I try to resolve with intellsence the only Size types availble to me are System.Drawing and Xamarin.Forms. None of these are suitable for MeasureOverride.
Can anyone help with this? What is it that I am missing?
Thanks in advance.
xaml xamarin
docs.microsoft.com/en-us/uwp/api/… have you checked this link ? as i see from hereMeasureOverride
child ofWindows.UI.Xaml
– Halil İbrahim
Nov 26 '18 at 14:31
@Halilİbrahim In my environment the namespace inlineWindows.UI.Xaml
does not have the type Panel. Instead it looks as if it's been moved toWindows.UI.Xaml.Controls
. There is a link to Size in the page you linked that takes me toWinows.Foundation
again.
– Jack Davenport
Nov 26 '18 at 14:39
try to remove the namespace that contains Size property inside it. then let the visual studio pop up the true namespace for you. maybe this can help
– Halil İbrahim
Nov 26 '18 at 14:44
Unfortunately the Panel propery is listed only underWindows.UI.Xaml.Controls
and Size can be found only underSystem.Drawing
orXamarin.Forms
, neither of which are suitable.
– Jack Davenport
Nov 26 '18 at 14:48
There is no control calledpanel
in Xamarin.forms. It's a control ofUWP
. You should customize panel underUWP
project instead of Xamarin.forms.
– Jack Hua - MSFT
Nov 27 '18 at 2:28
|
show 1 more comment
I've been following some tutorials to learn Xamarin/Xaml. I'm currently looking at custom panels.
My custom Panel class is currently as follows:
using System;
using System.Collections.Generic;
using System.Text;
using Windows.Foundation;
using Windows.UI.Xaml.Controls;
public class MyCustomPanel : Panel
{
protected override Size MeasureOverride(Size size)
{
return base.MeasureOverride(size);
}
}
With this code i get:
The type or namespace 'Size' could not be found (are you missing a
using directive or an assembly reference?)
Intellisense tells me (hovering over the base MeasureOverride) that the type of Size I'm looking for is Windows.Foundation.Size however I'm already using Windows.Foundation. It does not have a type of Size.
If I try to resolve with intellsence the only Size types availble to me are System.Drawing and Xamarin.Forms. None of these are suitable for MeasureOverride.
Can anyone help with this? What is it that I am missing?
Thanks in advance.
xaml xamarin
I've been following some tutorials to learn Xamarin/Xaml. I'm currently looking at custom panels.
My custom Panel class is currently as follows:
using System;
using System.Collections.Generic;
using System.Text;
using Windows.Foundation;
using Windows.UI.Xaml.Controls;
public class MyCustomPanel : Panel
{
protected override Size MeasureOverride(Size size)
{
return base.MeasureOverride(size);
}
}
With this code i get:
The type or namespace 'Size' could not be found (are you missing a
using directive or an assembly reference?)
Intellisense tells me (hovering over the base MeasureOverride) that the type of Size I'm looking for is Windows.Foundation.Size however I'm already using Windows.Foundation. It does not have a type of Size.
If I try to resolve with intellsence the only Size types availble to me are System.Drawing and Xamarin.Forms. None of these are suitable for MeasureOverride.
Can anyone help with this? What is it that I am missing?
Thanks in advance.
xaml xamarin
xaml xamarin
asked Nov 26 '18 at 14:25
Jack DavenportJack Davenport
64
64
docs.microsoft.com/en-us/uwp/api/… have you checked this link ? as i see from hereMeasureOverride
child ofWindows.UI.Xaml
– Halil İbrahim
Nov 26 '18 at 14:31
@Halilİbrahim In my environment the namespace inlineWindows.UI.Xaml
does not have the type Panel. Instead it looks as if it's been moved toWindows.UI.Xaml.Controls
. There is a link to Size in the page you linked that takes me toWinows.Foundation
again.
– Jack Davenport
Nov 26 '18 at 14:39
try to remove the namespace that contains Size property inside it. then let the visual studio pop up the true namespace for you. maybe this can help
– Halil İbrahim
Nov 26 '18 at 14:44
Unfortunately the Panel propery is listed only underWindows.UI.Xaml.Controls
and Size can be found only underSystem.Drawing
orXamarin.Forms
, neither of which are suitable.
– Jack Davenport
Nov 26 '18 at 14:48
There is no control calledpanel
in Xamarin.forms. It's a control ofUWP
. You should customize panel underUWP
project instead of Xamarin.forms.
– Jack Hua - MSFT
Nov 27 '18 at 2:28
|
show 1 more comment
docs.microsoft.com/en-us/uwp/api/… have you checked this link ? as i see from hereMeasureOverride
child ofWindows.UI.Xaml
– Halil İbrahim
Nov 26 '18 at 14:31
@Halilİbrahim In my environment the namespace inlineWindows.UI.Xaml
does not have the type Panel. Instead it looks as if it's been moved toWindows.UI.Xaml.Controls
. There is a link to Size in the page you linked that takes me toWinows.Foundation
again.
– Jack Davenport
Nov 26 '18 at 14:39
try to remove the namespace that contains Size property inside it. then let the visual studio pop up the true namespace for you. maybe this can help
– Halil İbrahim
Nov 26 '18 at 14:44
Unfortunately the Panel propery is listed only underWindows.UI.Xaml.Controls
and Size can be found only underSystem.Drawing
orXamarin.Forms
, neither of which are suitable.
– Jack Davenport
Nov 26 '18 at 14:48
There is no control calledpanel
in Xamarin.forms. It's a control ofUWP
. You should customize panel underUWP
project instead of Xamarin.forms.
– Jack Hua - MSFT
Nov 27 '18 at 2:28
docs.microsoft.com/en-us/uwp/api/… have you checked this link ? as i see from here
MeasureOverride
child of Windows.UI.Xaml
– Halil İbrahim
Nov 26 '18 at 14:31
docs.microsoft.com/en-us/uwp/api/… have you checked this link ? as i see from here
MeasureOverride
child of Windows.UI.Xaml
– Halil İbrahim
Nov 26 '18 at 14:31
@Halilİbrahim In my environment the namespace inline
Windows.UI.Xaml
does not have the type Panel. Instead it looks as if it's been moved to Windows.UI.Xaml.Controls
. There is a link to Size in the page you linked that takes me to Winows.Foundation
again.– Jack Davenport
Nov 26 '18 at 14:39
@Halilİbrahim In my environment the namespace inline
Windows.UI.Xaml
does not have the type Panel. Instead it looks as if it's been moved to Windows.UI.Xaml.Controls
. There is a link to Size in the page you linked that takes me to Winows.Foundation
again.– Jack Davenport
Nov 26 '18 at 14:39
try to remove the namespace that contains Size property inside it. then let the visual studio pop up the true namespace for you. maybe this can help
– Halil İbrahim
Nov 26 '18 at 14:44
try to remove the namespace that contains Size property inside it. then let the visual studio pop up the true namespace for you. maybe this can help
– Halil İbrahim
Nov 26 '18 at 14:44
Unfortunately the Panel propery is listed only under
Windows.UI.Xaml.Controls
and Size can be found only under System.Drawing
or Xamarin.Forms
, neither of which are suitable.– Jack Davenport
Nov 26 '18 at 14:48
Unfortunately the Panel propery is listed only under
Windows.UI.Xaml.Controls
and Size can be found only under System.Drawing
or Xamarin.Forms
, neither of which are suitable.– Jack Davenport
Nov 26 '18 at 14:48
There is no control called
panel
in Xamarin.forms. It's a control of UWP
. You should customize panel under UWP
project instead of Xamarin.forms.– Jack Hua - MSFT
Nov 27 '18 at 2:28
There is no control called
panel
in Xamarin.forms. It's a control of UWP
. You should customize panel under UWP
project instead of Xamarin.forms.– Jack Hua - MSFT
Nov 27 '18 at 2:28
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53483187%2fxamarin-custom-panels-size-type-missing-what-references-do-i-need%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53483187%2fxamarin-custom-panels-size-type-missing-what-references-do-i-need%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
docs.microsoft.com/en-us/uwp/api/… have you checked this link ? as i see from here
MeasureOverride
child ofWindows.UI.Xaml
– Halil İbrahim
Nov 26 '18 at 14:31
@Halilİbrahim In my environment the namespace inline
Windows.UI.Xaml
does not have the type Panel. Instead it looks as if it's been moved toWindows.UI.Xaml.Controls
. There is a link to Size in the page you linked that takes me toWinows.Foundation
again.– Jack Davenport
Nov 26 '18 at 14:39
try to remove the namespace that contains Size property inside it. then let the visual studio pop up the true namespace for you. maybe this can help
– Halil İbrahim
Nov 26 '18 at 14:44
Unfortunately the Panel propery is listed only under
Windows.UI.Xaml.Controls
and Size can be found only underSystem.Drawing
orXamarin.Forms
, neither of which are suitable.– Jack Davenport
Nov 26 '18 at 14:48
There is no control called
panel
in Xamarin.forms. It's a control ofUWP
. You should customize panel underUWP
project instead of Xamarin.forms.– Jack Hua - MSFT
Nov 27 '18 at 2:28