I am creating a user control Library in windows phone. It has default images in it for background and icons.
The code I am writing in my user control file is
<ImageBrush ImageSource="/Assets/dropDownArrow.png"/>
/Assets/dropDownArrow.png is refered to the location in the project where the usercontrol is being used.
But I want to store these images or any file in my user controller's .dll.
Can anyone help me in this?
Thanks
In VS's solution explorer right-click on your image, select Properties and here set Build Content to Resource. Image will be compiled into DLL.
For this, Use DependencyProperty. Set The DependencyProperty To ImageSource.
and whereever you want to use this in code, make a function and pass values
Related
I am trying to create a C# application that runs in tray where I can drop files on it's icon.
Is there any way to get the path of the file dropped on the System Tray icon? System.Windows.Forms.NotifyIcon does not have any events related to drag and drop.
it's not possible to do this, the easy way.
You can show a dummy Form, if the cursor is in a special area near the notifyicon.
The dummy Form can get the filepath of the droped file.
It has az example, but it's not fully and written in C++ :(
DragnDropOnTrayIcon
It actually is possible to do with a slightly hacky method. Fluffy App does this for its file uploader. It uses Spifftastic which uses a pretty neat little method to identify the location of the tray icon. Then a transparent window is placed over the location of the icon and used as the actual drop target, but to the end user it all appears to be dropping the file on the icon.
I need to create an app that has a few setttings that need to be set before the application can continue i would like to do that using some sort of wizard. I looked at other apps and found that the 'Kid's corner' app does exactly what i want.
My question is is that a default control or is it a custom control. If it's a custom control how would one create one.
There is no specific template to accomplish this task. The most common way to do it would be to create a separate page for the wizard. On the page you'll use various controls to actually create a settings page. Most likely these will include Textblock (for static text), TextBox (for text entry), and ToggleSwitch for binary (e.g. On/Off) options. Here's an example of what you could use to create a very simple welcome wizard that allows the user to turn live tiles on or off.
<TextBlock Text="Welcome to the app!">
<ToggleSwitch x:Name="toggleSwitch1" Header="Turn on live tiles?"
OnContent="On" OffContent="Off"
Toggled="ToggleSwitch_Toggled"/>
If you need more info please ask :)
Reference for ToggleSwitch: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868198.aspx
Goal
I want to be able to access AutoCAD's Color chooser from an external application. This means that I will not be using AutoCAD to make the color chooser dialog popup. Instead, I will be using a VB.Net application to manage these colors.
Current Situation
As for now, I have no idea where to start. Do I need to import a specific library to make this work? Is it even possible to do this without AutoCAD running?
.NET has a basic built-in color picker control if you want to drive outside of AutoCAD:
System.Windows.Forms.ColorDialog
You'll likely need a helper class/extension methods for converting ARGB colors to AutoCAD colors. Although may find it better to just roll your own. Use IlSpy, DotPeek, or .NET Reflector to look at how the AutoDesk class gets instanciated/used.
i am using a c# flyout in my windows 8 store app. When i open my custom flyout (i.e. Settings) i want to hide the advertisment that is in the page below the flyout. Is
there a way that i can refer to this Ad within the code of my flyout page?
Thanks very much
The best practice is to use attached behavior (see nuget package winrtbehavior), you can attach the property and when the popup is loaded you can invoke the command to hide the adcontrol
I'm working on a windows phone project where I have some xml files with a layout in each of them. How can I make programmatically one of them the current layout displayed in the application???? I'm working with C#. Thanks!!!
Use XamlReader Class.
Load the xaml into that XAMLReader, it will return which ever control it is.
Bind that to the view.