Skip to content

Instantly share code, notes, and snippets.

myapp.menuHome.buttonResources_postRender = function (element, contentItem) {
$(element).spOverlay(contentItem, 'Content/Images/TouchIcons/ResourcesLarge.png', { height:170, width:170});
};
myapp.menuHome.buttonDesigns_postRender = function (element, contentItem) {
$(element).spOverlay(contentItem, 'Content/Images/TouchIcons/DesignsLarge.png');
};
myapp.menuHome.buttonProjects_postRender = function (element, contentItem) {
$(element).spOverlay(contentItem, 'Content/Images/TouchIcons/ProjectsLarge.png');
@incoplex
incoplex / PremiumComponentFactory
Created September 14, 2019 03:46 — forked from iamrommel/PremiumComponentFactory
Using the Microsoft.LightSwitch.ExportProvider.dll to utilize the MEF in LightSwitch
using System;
using LightSwitchApplication.UserCode.Constants;
using Microsoft.VisualStudio.ExtensibilityHosting;
using System.Linq;
namespace LightSwitchApplication.UserCode.Premium
{
/// <summary>
/// To centralize the method selection use this factory
/// So in the future it will not be cluttered
body
{
background: url(TMMSCM.jpg) center bottom fixed;
background-repeat: no-repeat;
height: 100%;
width: 100%;
background-size: cover;
}
@incoplex
incoplex / Generic Equality comparer
Created September 14, 2019 03:48 — forked from iamrommel/Generic Equality comparer
Generic Equality comparer that can be used of linq
using System;
using System.Collections.Generic;
namespace LightSwitchApplication
{
/// <summary>
/// Generic Equality comparer that can be used of linq
/// </summary>
/// <typeparam name="T"></typeparam>
public class EqualityComparer<T> : IEqualityComparer<T>
@incoplex
incoplex / Keyboard Shortcut
Created September 14, 2019 03:48 — forked from iamrommel/Keyboard Shortcut
Creating a keyboard shortcuts for Lightswitch application
partial void Tickets_Created()
{
this.FindControl("ScreenLayout").ControlAvailable += Tickets_ControlAvailable;
}
void Tickets_ControlAvailable(object sender, Microsoft.LightSwitch.Presentation.ControlAvailableEventArgs e)
{
var screenLayout = e.Control as System.Windows.Controls.Grid;
if (screenLayout == null) return;
@incoplex
incoplex / oncollectionchange
Created September 14, 2019 03:48 — forked from iamrommel/oncollectionchange
On collection changed, trap the added item and put some logic and set value for it
partial void Plants_Changed(NotifyCollectionChangedEventArgs e)
{
if (e.Action == NotifyCollectionChangedAction.Add)
{
var addedItem = e.NewItems[0] as HaulerPlant;
if (addedItem == null) return;
addedItem.IsActive = true;
}
@incoplex
incoplex / lightswitchPortFindingHack.cs
Created September 14, 2019 03:50 — forked from namman/lightswitchPortFindingHack.cs
Lightswitch port finding hack
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Management;
using System.Linq;
using System.Text.RegularExpressions;
namespace YourApp
{
using System;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Microsoft.LightSwitch.Framework.Client;
using LightSwitch = Microsoft.LightSwitch.Model.Storage;
using Microsoft.LightSwitch.Model;
using System.Runtime.InteropServices.Automation;
namespace ODataFinderLibrary
@incoplex
incoplex / MyGroupProvider.cs
Created September 14, 2019 03:56 — forked from sschutten/MyGroupProvider.cs
Implement IShellCommandGroupProvider
[Export(typeof(IShellCommandGroupProvider))]
public class MyGroupProvider : IShellCommandGroupProvider
{
    public IEnumerable<IShellCommandGroup> GetShellCommandGroups(Microsoft.LightSwitch.Client.IScreenObject currentScreen)
    {
        yield return new MyGroup();
    }
}
@incoplex
incoplex / MyCommand.cs
Created September 14, 2019 03:56 — forked from sschutten/MyCommand.cs
Implement IShellCommand
public class MyCommand : IShellCommand
{
    public string Description
    {
        get { return "This is My Command"; }
    }
 
    public string DisplayName
    {
        get { return "My Command"; }