Property not visible - visual-studio-2010

I've a problem with a datagrid on a simple windows form project (framework 4.0, VS2010).
In the code behind is not possible to access to the datagrid.Columns property. Am I missing an assembly reference?
These are my references:
Microsoft.CSharp,
System,
System.Core,
System.Data,
System.Data.DataSetExtensions,
System.Data.Entity,
System.Deployment,
System.Drawing,
System.Runtime.Serialization,
System.Security,
System.Windows.Forms,
System.Windows.Form.Ribbon35,
System.xml,
System.Xml.Linq,
WindowsBase,
WPFToolkit.Extended

I'm not sure but I don't see the System.Windows.Controls and you need that.
Assembly for datagrid columns: system.windows.controls.datagrid.columns
Also I want to suggest you Resharper a very nice tools when you have missing assemblies.

Maybe I figured out. That property seems to exist for wpf components only. In fact, for Windows form the datagrid assembly is System.Windows.Form while for wpf component is PrsentationFramework (System.Windows.Controls)

Related

The type or namespace name 'DotNetNuke' could not be found

I built a custom theme for DNN several months ago using the Christoc templates for Visual Studio. I needed to make a small HTML adjustment today so I re-opened the solution and made the change but when I rebuilt the project, I get several build errors, presumably because it no longer recognizes my DNN dll:
The type or namespace name 'DotNetNuke' could not be found (are you missing a using directive or an assembly reference?)
I checked my C:\path_to\dnndev.me\bin\DotNetNuke.dll and it's still there so I'm not sure why Visual Studio isn't seeing it.
When I built the skin originally, I was running DNN 9.1.1 but have since upgraded to 9.3.2. Could that be causing my issue?
I read elsewhere that I could be building on the incorrect version of .NET framework but I don't know what version to use for DNN 9.3.2 so I tried several different version with no change in results.
How can I solve this issue?
UPDATE:
Per the answer here, I rebuilt with .NET 4.7.2 and it did not solve my issue.
UPDATE 2:
Okay, so the small change I made was adding another layout page like the Home.ascx and Edit.ascx files that come with the template. If I remove the new layout files, the project builds fine.
What could I be doing wrong when adding a new layout?
What you read about the .Net framework version is correct. You need to 4.7.2.
The problem was a new layout I had created. I right clicked on the project and selected Add > New Item and chose Web Forms User Control. This was the wrong way to add a new layout.
I successfully added it by copy/pasting one of the template's pre-existing layouts and renaming it. The project builds fine now.
Ah, now I understand what went wrong. Adding a Web (Forms) User Control is not completely wrong, as a skin (or theme) is a kind of Web User Control, and has the same extension (.ascx).
What you have to do is deleting the code behind file (.ascx.vb or .ascx.cs), and change the first line of the ascx file to
<%# Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Skin" %>
(But copying another skin file is also a good solution as propably you have most of the references to the skin object already there)

Accessing resources XML from another library project in Xamarin.Android

I am trying to create a Xamarin.Android Component to send to the Xamarin Component Store, and I need to bundle my Colors.xml with it, so it is accessible to everyone using my component. I am setting the build action for the Colors.xml tp "AndroidResource".
So I created an Android sample application, when I add a reference to my library project's dll, I am able to use the colors defined, my project compiles and it runs, but I get no intellisense on Xamarin Studio. So that would be a bad thing for anyone using my library, as they would not be able to even see that the colors are available to use. You can see in this picture the colors defined are not available in the suggestions box.
If I add the Colors.xml directly into my project, I get Intellisense support, like this:
Is there a way to achieve the same result above when adding just the dll reference? Did I do something wrong or Xamarin.Android/Xamarin Studio doesn't support this kind of scenario?
EDIT: To be clear, I know this is a problem with Intellisense not being able to pick up the values, but is there anything I can do to make it work?

Multi-targeted WP7.1/WP8 app with Windows Phone Toolkit (Panorama / LongListSelector)

Was wondering if someone had a good idea of how to handle this.
In WP7.1, we can utilize the excellent Windows Phone Toolkit to include some useful controls such as LongListSelector and Panorama. These are part of the Microsoft.Phone.Controls.Toolkit assembly.
In WP8, we do not need the toolkit for those two controls because they're part of the official Microsoft.Phone.Controls assembly.
I have multi-targeted my app so that I have two phone projects, WP71 and WP80, where I link files in WP80 to files in WP71.
This works great until I try to use the Panorama or LongListSelector control in a XAML page. In the WP80 project, if I reference the WP80 DLL of the phone toolkit, it does not include the two aforementioned controls because, surprise, they're already present.
The issue is, WP71 needs the namespace declaration at the top of the XAML and the namespace is different for both projects.
WP71:
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
<toolkit:Panorama />
WP80:
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
<phone:Panorama />
I cannot build the projects because each project thinks the namespace is incorrect if I just use one because they need to point to different assemblies.
I don't think I can use compile constants in my XAML, otherwise that would be a fix.
My workaround was originally to just reference the older WP71 DLL in my WP80 project. But other 3rd party libraries bind against the official 8.0 SDK DLL (Caliburn, in my case) so it causes problems.
How can I solve this pickle? The only idea off the top of my head was to resort to code-behind to create the instance of the control :( Is there a better way?
Don't use a link, create a separate view for each.
Another solution might be to create a PanoramaEx control in each of the relative projects and inherit from Panorama. Then the view would reference the PanoramaEx control and you could still use a link to a single view. That's if both UI projects have the same namespace.
Edit: isn't panorama for WP7 in the namespace:
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
I do use my initial solution for ProgressBar and PerformanceProgressBar, I have a ProgressBarEx in each UI project, the WP7 one inherits from ProgressBar and the WP8 one inherits from PerformanceProgressBar and then in the views I reference ProgressBarEx.
Might not be the most elegant solution, but you can try to use a T4 file (.tt file) to generate both targets.
<## template language="C#" hostspecific="true"#>
<## output extension=".xaml"#>
<## assembly name="EnvDTE" #>
<phone:PhoneApplicationPage
x:Class="PhoneAppDemo.Pages.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
<# IServiceProvider serviceProvider = (IServiceProvider)Host;
EnvDTE.DTE dte = (EnvDTE.DTE)serviceProvider.GetService(typeof(EnvDTE.DTE));
var configName = dte.Solution.SolutionBuild.ActiveConfiguration.Name;
if (configName == "WP7") { #>
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
<# }else{ #>
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
<# } #>
>
<# include file="Page.xaml" #>
</phone:PhoneApplicationPage>
In this example, the inner content of the Page is in "Page.xaml". We just encapsulate it in <phone:PhoneApplicationPage> at processor time, based on the target name (usually Debug and Release, but in this example we assumed there was a target WP7).
For other stuff related to a multi-targeted silverlight app, you can always read Maintaining a WP7 and WP8 version of a same Silverlight application.

ToggleSwitch not worked in windowsphone7.5

I used ToggleSwitch control in windowsphone, It works fine in windowsphone7 version, takes Microsoft.Phone.Controls as a assembly reference. But in the windowsphone7.5 it asks assembly reference for ToggleSwitch control, it's not included in Microsoft.Phone.Controls. Anyone know the assembly reference for windowsphone7.5 ToggleSwitch control.
The ToggleSwitch control is part of the Silverlight Toolkit, and is part of the namespace Microsoft.Phone.Controls.
To enable it in your project, add a reference to the toolkit dll (or better yet, use NuGet to install it), and then reference the namespace in your XAML
(I'm sure you already know this stuff, and that the actual alias you choose isn't important as long as you use the same one when adding the control to the XAML - using "toolkit" here because that's what I normally do)
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
and make sure your declaration of the control in the XAML includes the namespace reference...
<toolkit:ToggleSwitch ... ><!-- more stuff here --></toolkit:ToggleSwitch>

Silverlight ChartingToolKit is not coming in xaml page

i wanted to implement charts in my silverlight app.
i have installed SL4 in my VS.
The problem is i m not getting the chartingToolkit:Chart control in my xaml page.
Gives error saying control not found .
Did i forget to add any references?
or did my installation went wrong?
do i have to download any other plugin?
Thanks
Sajad
chartings controls are from the Silverlight toolkit, you need to install it first.;)
http://silverlight.codeplex.com/
i have added the assemblies as mentioned by Xin.
System.Windows.Controls.DataVisualization.Toolkit,
System.Windows.Controls.Toolkit
System.Windows.Controls.Toolkit.Internals
But my problem was actually solved by adding this to namespace area.
xmlns:toolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
and then i could use toolkit:Chart
:)

Resources